Thursday, February 28, 2013

SSH without password

SSH to server/client without entering ssh password:

I would like to thank my friend, guide Mr. Rajendra to help me.

Suppose there are two Linux machines. In my case both were ubuntu machines say buntu1 and buntu2

On buntu1  machine-
# ssh-keygen -t rsa
# cat ~/.ssh/id_rsa.pub | ssh  user_buntu2@buntu2 'cat >> ~/.ssh/authorized_keys'

Here it will ask the password once to open ssh to buntu2. 

On buntu2  machine-
# ssh-keygen -t rsa
# cat ~/.ssh/id_rsa.pub | ssh  user_buntu1@buntu1 'cat >> ~/.ssh/authorized_keys'

Here it will ask the password once to open ssh to buntu1. 

From now on, ssh will never ask for password.