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:
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