Last week, I learnt to set up a auto ssh login with remote machines. This will be very useful if you are connecting other machines regularly to linux servers. I thought it will be useful for every if I share it here. Thanks to my colleague Srivatsan who helped me to get it work.
Before you setup auto login, this is how ssh login works. Once you enter the command it will ask for password.
$ ssh -l
XXXXXXXs password:
Let's now see how to set up automatic ssh login with linux machines.
1. first generate a private and public keys using ssh-keygen tool
$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/test/.ssh/id_rsa): sshkeys
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in sshkeys.
Your public key has been saved in sshkeys.pub.
The key fingerprint is:
when it asks to enter passphrase you may just hit enter for empty phrase. That's it you are done with the first step. It will create two files. One is a public key file named sshkeys.pub and another one is private key file named sshkeys
2. Place private key file named sshkeys under
3. Now transfer the file sshkeys.pub to the remote machine to which you want to setup auto ssh login. In remote machine append the file
cat sshkeys.pub >>
3. Most importantly give following permission only for the files, directories in the remote machine
For
For
Now try ssh -l
Hope you like it.
Regards,
Subramanian T