Difference between revisions of "SSH"

From Useful Things
Jump to: navigation, search
Line 1: Line 1:
== Common arguments ==
+
== Upload SSH public key to remote host ==
<code>-r</code> recursive<br />
+
cat /root/.ssh/id_rsa.pub | ssh root@remotehost 'cat >> /root/.ssh/authorized_keys'
<code>-P</code> port number (default 22)
 
 
 
== Push a file ==
 
<source lang="bash">
 
scp ./path/to/source user@host:/path/to/destination
 
</source>
 
 
 
== Pull a file ==
 
<source lang="bash">
 
scp user@host:/path/to/source ./path/to/destination
 
</source>
 

Revision as of 01:39, 4 July 2014

Upload SSH public key to remote host

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