snipt

Ctrl+h for KB shortcuts
Announcing Snipt for Teams!
Starting at just $49/month.
#138107

Bash

bugfix "Could not load host key /etc/ssh/ssh_host_..."

1
2
3
# error: Could not load host key: /etc/ssh/ssh_host_ed25519_key
# Regenerates any missing keys:
$ ssh-keygen -A
https://snipt.net/embed/6ac532ae5b57a28cfd810f876f7bb91f/
https://snipt.net/raw/6ac532ae5b57a28cfd810f876f7bb91f/
6ac532ae5b57a28cfd810f876f7bb91f
bash
Bash
4
2015-08-02T02:04:48
True
False
Feb 03, 2015 at 11:54 PM
/api/public/snipt/138107/
bugfix-could-not-load-host-key-etcsshssh_host_-7f87c683
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="c"># error: Could not load host key: /etc/ssh/ssh_host_ed25519_key</span> </span><span id="L-2"><a name="L-2"></a><span class="c"># Regenerates any missing keys:</span> </span><span id="L-3"><a name="L-3"></a><span class="nv">$ </span>ssh-keygen -A </span></pre></div> </td></tr></table>
aws, linux, ssh, ssh-keygen, ubuntu
#114552

Shell Session

Import sql file to MySQL database using SSH

mysql -p -u DB_USERNAME DB_NAME < PATH/TO/FILE.sql
https://snipt.net/embed/2889d808e26a0fbea9ed3b8e1bfeeecf/
https://snipt.net/raw/2889d808e26a0fbea9ed3b8e1bfeeecf/
2889d808e26a0fbea9ed3b8e1bfeeecf
shell-session
Shell Session
1
2015-08-02T05:28:36
True
False
Feb 17, 2014 at 05:03 PM
/api/public/snipt/114552/
import-sql-file-to-mysql-database-using-ssh
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="go">mysql -p -u DB_USERNAME DB_NAME &lt; PATH/TO/FILE.sql</span> </span></pre></div> </td></tr></table>
database, mysql, sql, ssh, terminal
#111141

Shell Session

Mount remote server drive with OSXFUSE and ssh

sshfs [-p PORT-NUMBER] USERNAME@MYDOMAIN.com:/remote/path /Local/Path/to/an/existing/folder
https://snipt.net/embed/178080a463bae7bdfcf47a9de1f1fd0b/
https://snipt.net/raw/178080a463bae7bdfcf47a9de1f1fd0b/
178080a463bae7bdfcf47a9de1f1fd0b
shell-session
Shell Session
1
2015-08-02T02:24:10
True
False
Feb 05, 2014 at 09:52 AM
/api/public/snipt/111141/
mount-remote-server-drive-with-osxfuse-and-ssh
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="go">sshfs [-p PORT-NUMBER] USERNAME@MYDOMAIN.com:/remote/path /Local/Path/to/an/existing/folder</span> </span></pre></div> </td></tr></table>
commandline, mac, server, ssh, terminal
#87287

Bash

SCP file from local to remote server over ssh using pem key

scp -i /path/to/key.pem /path/to/file.jpg <username>@<server ip address>:/path/to/place/file
https://snipt.net/embed/e1839c5e3d32b62b6ee527d714e4b2f8/
https://snipt.net/raw/e1839c5e3d32b62b6ee527d714e4b2f8/
e1839c5e3d32b62b6ee527d714e4b2f8
bash
Bash
1
2015-08-02T09:44:38
True
False
/api/public/snipt/87287/
scp-file-from-local-to-remote-server-over-ssh-using-pem-key
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>scp -i /path/to/key.pem /path/to/file.jpg &lt;username&gt;@&lt;server ip address&gt;:/path/to/place/file </span></pre></div> </td></tr></table>
copy, file, local, remote, scp, server, ssh, to
#78646

Bash

Clear contents of file but dont delete it

cat /dev/null > file
https://snipt.net/embed/bb4c74f5bb5471cfee5e14aa071214d5/
https://snipt.net/raw/bb4c74f5bb5471cfee5e14aa071214d5/
bb4c74f5bb5471cfee5e14aa071214d5
bash
Bash
1
2015-08-02T09:32:56
True
False
Sep 03, 2013 at 05:12 AM
/api/public/snipt/78646/
clear-contents-of-file-but-dont-delete-it
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>cat /dev/null &gt; file </span></pre></div> </td></tr></table>
bash, clear, linux, ssh
#69685

Text only

Disable ssh host key checking in Linux

ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no user@server
https://snipt.net/embed/259724021f8d5001ce10aeed11e33b0f/
https://snipt.net/raw/259724021f8d5001ce10aeed11e33b0f/
259724021f8d5001ce10aeed11e33b0f
text
Text only
1
2015-08-01T00:53:45
True
False
Jul 26, 2013 at 05:12 AM
/api/public/snipt/69685/
disable-ssh-host-key-checking-in-linux
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no user@server </span></pre></div> </td></tr></table>
Linux, host-key-checking, ssh
#64882

Bash

SSH con certificato (pem) e utente

ssh -l USERNAME_HERE -i PTAH_TO_KEY.pem HOSTNAME
https://snipt.net/embed/cf64844c99b8fcc2bc30c0507241c5c2/
https://snipt.net/raw/cf64844c99b8fcc2bc30c0507241c5c2/
cf64844c99b8fcc2bc30c0507241c5c2
bash
Bash
1
2015-08-02T00:08:51
True
False
Jun 19, 2013 at 07:33 AM
/api/public/snipt/64882/
ssh-con-certificato-pem-e-utente
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>ssh -l USERNAME_HERE -i PTAH_TO_KEY.pem HOSTNAME </span></pre></div> </td></tr></table>
conn, ssh, utils
Copyrighted, illegal, or inappropriate content? Email nick@snipt.net.