Christopher Juckins

SysAdmin Tips, Tricks and other Software Tools

User Tools

Site Tools


ssh_without_a_password_using_public_private_keys

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ssh_without_a_password_using_public_private_keys [2008/01/30 21:25] juckinsssh_without_a_password_using_public_private_keys [2009/02/12 11:43] (current) juckins
Line 3: Line 3:
 need to configure client (machine connecting from) and server (machine connecting to) \\ need to configure client (machine connecting from) and server (machine connecting to) \\
 on client:  create dsa and rsa public and private keys with the following: \\ on client:  create dsa and rsa public and private keys with the following: \\
-cd to ~/.ssh \\ +<code> 
-ssh-keygen -t rsa -f ~/.ssh/id_rsa \\ +cd ~/.ssh 
-ssh-keygen -t dsa -f ~/.ssh/id_dsa \\+ssh-keygen -t rsa -f ~/.ssh/id_rsa 
 +ssh-keygen -t dsa -f ~/.ssh/id_dsa 
 +</code>
 this creates id_dsa, id_dsa.pub, id_rsa, id_rsa.pub - optionally can enter a 'passphrase' when prompted \\ this creates id_dsa, id_dsa.pub, id_rsa, id_rsa.pub - optionally can enter a 'passphrase' when prompted \\
  
 on server: \\ on server: \\
-cd ~/.ssh/ \\ +<code> 
-create authorized_keys files+cd ~/.ssh/ 
 +</code> 
 +vi authorized_keys2 \\
 copy the id_dsa.pub and id_rsa.pub from client into authorized_keys file \\ copy the id_dsa.pub and id_rsa.pub from client into authorized_keys file \\
 make sure permissions 644 on authorized_keys \\ make sure permissions 644 on authorized_keys \\
 +Also:
 +<code>
 +chmod 0700 /home/<user's-home-directory>/.ssh -R
 +</code>
  
 Repeat process for creating keys on server, and copy the .pub keys to the client's ~/.ssh/authorized_keys file. \\ Repeat process for creating keys on server, and copy the .pub keys to the client's ~/.ssh/authorized_keys file. \\
Line 19: Line 27:
  
 To restart sshd: kill running sshd process \\ To restart sshd: kill running sshd process \\
-issue the command /sbin/init.d/sshd \\+now issue
 +<code>/sbin/init.d/sshd 
 +</code>
  
-Or for Red Hat systems: service sshd restart \\+Or for Red Hat systems: 
 +<code> 
 +service sshd restart 
 +</code>
ssh_without_a_password_using_public_private_keys.1201746308.txt.gz · Last modified: 2008/01/30 21:25 by juckins