Monday, December 23, 2013

ssh without password

Step 1
 sys-jmtoung-mbr:Data jmtoung$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/jmtoung/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/jmtoung/.ssh/id_rsa.
Your public key has been saved in /Users/jmtoung/.ssh/id_rsa.pub.
The key fingerprint is:
c4:14:ed:6f:fd:d2:93:2d:e7:f7:f5:64:8c:58:d0:6a jmtoung@sys-jmtoung-mbr.local
The key's randomart image is:
+--[ RSA 2048]----+
|        oo       |
|       o  .  .   |
|        o.  . .  |
|       .  .  o   |
|        S  .E..  |
|           .oo.o |
|           .. .oB|
|              o=O|
|               =B|

+-----------------+

Step 2

sys-jmtoung-mbr:Data jmtoung$ cat ~/.ssh/id_rsa.pub | ssh jmtoung@buttelab-phi1.stanford.edu "cat - >> ~/.ssh/authorized_keys"

Step 3

[jmtoung@buttelab-phi1 .ssh]$ chmod 0600 authorized_keys