Skip to main content

SSH login without password.



  • Login as “root” on “spicykerala.co.in” and generate a pair of authentication keys. Note: even if is unsecured to work without password, do not enter it. Let it empty...

[root@spicykerala]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
b4:35:f8:0e:44:ba:b1:85:ea:17:d3:41:da:8b:58:ed root@spicykerala.co.in
The key's randomart image is:
+--[ RSA 2048]----+
| o                          |
| O .                        |
| * O o                    |
| + @ * .                 |
| o * E .                   |
| . o o                      |
| . . .                        |
| .                            |
|                              |
+----------------------+
  • Then go to /root/.ssh/ directorey. (Here I'm using 'root' user, if you are using some other user do the folowing. For example you are using 'admin' user; then go to /home/admin/.ssh/)

[root@spicykerala]# cd /root/.ssh/
[root@spicykerala .ssh]# ls
id_rsa id_rsa.pub

  • Rename 'id_rsa.pub' to 'authorized_keys'

[root@spicykerala]# cp id_rsa.pub authorized_keys

  • Then copy the “authorized_keys” file to the other computer which you want to login without password. For example here I'm using the hostname as “amazingindia.co.in”. For this time you have to give the password. After that you will get a password less communication from spicykerala.co.in to amazingindia.co.in. Vice versa is not possible. For that you have to run the command ssh-keygen -t rsa in amazingindia.co.in and copy the content of id_rsa.pub and append to autorized_keys files in both computers.

[root@spicykerala]# scp /root/.ssh/authorized_keys root@amazingindia.co.in:/root/.ssh/

(If /root/.ssh directory is not yet created create it manually. There is no problem)

Then copy authorized_keys to /root/.ssh/ directory. 
  • You can give the IP of the remote server (amazingindia.co.in). For example here I'm using 192.168.1.2 for amazingindia.co.in. Then do the following.

[root@spicykerala]# scp /root/.ssh/authorized_keys root@192.168.1.2:/root/.ssh/



Enjoy Password less Communication. 

Comments