Sunday, March 18, 2012

How to create keys on ssh

- On your local machine: ssh-keygen -t rsa

Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/user/.ssh/id_rsa.
Your public key has been saved in /home/user/.ssh/id_rsa.pub.
The key fingerprint is:
be:fd:e4:c6:bb:b5:20:4d:ea:9c:76:39:db:7a:70:f3 user@centosvm03


- Server A is the server that you would like to ssh into from your local machine:
cat .ssh/id_rsa.pub | ssh user @A 'cat >> .ssh/authorized_keys'

Thats it!!! Now, you can log into Server A from your local host without a password or with the passphrase if you didn't leave it blank.

No comments:

Post a Comment