I am Sharing Method to configure passwordless authentication.
Password-less Authentication between server to server or client to server is very risky. I have posted this how to for SSH Password-less Login but make sure you require this at any how.
Consider many times before you configure this. This can be the biggest security issue, So if you are knowing risks and you know what are the advantages and disadvantages then only implement this, Simple DO IT AT YOUR OWN RISK.
Follow this method to configure passwordless SSH Authentication:-
1. Execute Following Command :-
[tejas-barot@linux-tejas-barot-ahmedabad~] $ su – root
[root@linux-tejas-barot-ahmedabad ~] # ssh-keygen -t rsa
2.After executing below command it will start generating ssh key.
3. Now that will ask you where you want to save key i prefer that you store save that key on /root/.ssh/ if you dont want to change ssh key saving directory then just press Enter.
4.In Passphare dont give password just press Enter
5. Now it will generate ssh key and save it @ home directory
6.Now execute following command to copy your .pub file into remote server
[root@linux-tejas-barot-ahmedabad ~] # scp /root/.ssh/id_rsa.pub email@example.com:/root/.ssh/id_rsa.pub.server
The authenticity of host ‘192.168.0.3 (192.168.0.3)’ can’t be established.RSA key fingerprint is 1d:48:aa:5c:34:ac:05:5f:10:0d:df:b6:4f:d0:09:90.
Are you sure you want to continue connecting (yes/no)? yes
firstname.lastname@example.org’s password: ******** # Don’t expect Start (***)
Once Copy will done completely.Then Logon to Remote Machine
7. Log in to Remote Server by executing following command:
[root@linux-tejas-barot-ahmedabad ~] # ssh 192.168.0.3 email@example.com’s password: ******** # Don’t expect Star (***)
Your Remote Prompt Like below:-
[root@linux1-tejas-barot-ahmedabad ~]#cat /root/.ssh/id_rsa.pub.server >> /root/.ssh/authorized_keys
Now you are done Exit from Remote Machine.
8. From Your Local Computer Try to Connect remote pc which you had done above procedure.
[root@linux-tejas-barot-ahmedabad ~] # ssh 192.168.0.3
It will directly login to your remote PC without Asking Password
Enjoy Linux 🙂