Friday, April 10, 2009

LOGIN USING SSH KEYS

1.ssh-keygen generates, manages and converts authentication keys for ssh

root:~#ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
97:67:2b:55:6a:7e:ed:c3:e2:3e:14:3e:1b:7a:ee:12 root@localhost

After Running This Command, You will find id_dsa.pub file in ~root/.ssh/id_dsa.pub

2. Copy that id_dsa.pub file to another machine.

root:~# scp ~root/.ssh/id_dsa.pub root@host:.ssh/authorized_keys2

3. Now try to login using ssh root@xxxx

Enjoy.. :-)

No comments: