User Tools

Site Tools


computing:linux:ssh_keys

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
computing:linux:ssh_keys [2011/12/13 12:53]
gcooper
computing:linux:ssh_keys [2017/01/28 12:33] (current)
gcooper
Line 1: Line 1:
 ====== Set Up SSH Keys ====== ====== Set Up SSH Keys ======
 +
 +===== Common Use =====
  
 Use this command to set up your SSH key on a remote server that you log into frequently: Use this command to set up your SSH key on a remote server that you log into frequently:
  
 <file> <file>
-ssh-copy-id root@www.yourdomain.com+ssh-copy-id user@remote.host.name
 </file> </file>
  
-Or if the ''ssh-copy-id'' script is not available:+===== Without ssh-copy-id ===== 
 + 
 +If the ''ssh-copy-id'' script is not available:
  
 <file> <file>
-cat ~/.ssh/*.pub | ssh user@remote-system 'umask 077; cat >>.ssh/authorized_keys'+cat ~/.ssh/*.pub | ssh user@remote.host.name 'umask 077; cat >>.ssh/authorized_keys'
 </file> </file>
  
-or if SSH is on a non-standard port:+===== Non-Standard SSH Port ===== 
 + 
 +If SSH is on a non-standard port:
  
 <file> <file>
-cat ~/.ssh/*.pub | ssh -p 2222 root@www.sonoracomm.com 'umask 077; cat >>.ssh/authorized_keys'+ssh-copy-id -p 2222 user@remote.host.name 
 +</file> 
 +or: 
 +<file> 
 +cat ~/.ssh/*.pub | ssh -p 2222 root@remote.host.name 'umask 077; cat >>.ssh/authorized_keys'
 </file> </file>
  
-If no public key yet exists on the machine you will be using to make remote connections:+===== Generate Public Key ===== 
 + 
 +If no public key yet exists on the machine you will be using to make remote connections, you'll need to create one.  This is only done once:
  
 <file> <file>
-ssh-keygen -t dsa+ssh-keygen -t rsa
 </file> </file>
 +
 +You probably want to just hit enter at the passphrase prompt.
computing/linux/ssh_keys.1323805984.txt.gz · Last modified: 2011/12/13 12:53 by gcooper