Difference between revisions of "SSH"

From Useful Things
Jump to: navigation, search
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Push a file ==
+
== Common arguments ==
 +
<code>-p</code> port number (default 22)
 +
 
 +
== Upload SSH public key to remote host ==
 
<source lang="bash">
 
<source lang="bash">
scp ./path/to/source user@host:/path/to/destination
+
cat /root/.ssh/id_rsa.pub | ssh root@remotehost 'cat >> /root/.ssh/authorized_keys'
 
</source>
 
</source>
  
== Pull a file ==
+
== Generate public/private RSA key-pair ==
<source lang="bash">
+
<pre>ssh-keygen -t rsa -C 'user@host.com'</pre>
scp user@host:/path/to/source ./path/to/destination
+
 
</source>
+
== Test private key passpharse ==
 +
<pre>ssh-keygen -y</pre>

Latest revision as of 11:32, 26 January 2015

Common arguments

-p port number (default 22)

Upload SSH public key to remote host

cat /root/.ssh/id_rsa.pub | ssh root@remotehost 'cat >> /root/.ssh/authorized_keys'

Generate public/private RSA key-pair

ssh-keygen -t rsa -C 'user@host.com'

Test private key passpharse

ssh-keygen -y