Difference between revisions of "Using 'ssh-keygen' to automatically log you into clusters from your workstation"

From CUC3
Jump to navigation Jump to search
import>Mp466
import>Cen1001
 
Line 1: Line 1:
1. # local$ ssh-keygen -t dsa
+
1. # local$ ssh-keygen -t rsa
   
2. # local$ scp ~/.ssh/id_dsa.pub remote
+
2. # local$ scp ~/.ssh/id_rsa.pub remote:
   
 
3. # local$ ssh username@remote
 
3. # local$ ssh username@remote
   
4. # remote$ cat ~/id_dsa.pub >> ~/.ssh/authorized_keys
+
4. # remote$ cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
   
 
5. # remote$ chmod 644 ~/.ssh/authorized_keys - this was one of the things that kept throwing me, ssh doesn't like this file to be world of group writable.
 
5. # remote$ chmod 644 ~/.ssh/authorized_keys - this was one of the things that kept throwing me, ssh doesn't like this file to be world of group writable.
 
6. # remote$ exit
 
6. # remote$ exit
   
7. # local$ ssh username@remote - Now instead of the normal password you should be asked for the password you entered for your dsa key. This isn't passwordless yet but shows that ssh is using the key.
+
7. # local$ ssh username@remote - Now instead of the normal password you should be asked for the password you entered for your rsa key. This isn't passwordless yet but shows that ssh is using the key.
   
 
From http://blogs.translucentcode.org/mick/archives/000230.html
 
From http://blogs.translucentcode.org/mick/archives/000230.html
  +
  +
8. # local$ ssh-add - type the passphrase for the RSA key. Now you will get passwordless login to remote until you log out of your workstation.
  +
  +
[Edited to change dsa keys to rsa keys throughout as there's some evidence that RSA is a better algorithm]

Latest revision as of 17:27, 30 June 2008

1. # local$ ssh-keygen -t rsa

2. # local$ scp ~/.ssh/id_rsa.pub remote:

3. # local$ ssh username@remote

4. # remote$ cat ~/id_rsa.pub >> ~/.ssh/authorized_keys

5. # remote$ chmod 644 ~/.ssh/authorized_keys - this was one of the things that kept throwing me, ssh doesn't like this file to be world of group writable. 6. # remote$ exit

7. # local$ ssh username@remote - Now instead of the normal password you should be asked for the password you entered for your rsa key. This isn't passwordless yet but shows that ssh is using the key.

From http://blogs.translucentcode.org/mick/archives/000230.html

8. # local$ ssh-add - type the passphrase for the RSA key. Now you will get passwordless login to remote until you log out of your workstation.

[Edited to change dsa keys to rsa keys throughout as there's some evidence that RSA is a better algorithm]