Tuesday, September 25, 2012

ssh into a remote host without password

Other than the regular password based login, one can use the public/private key based login to get into a remote server.

This is a two step process.

On the local host

  1. ssh-keygen   // follow the prompts, enter nothing for the pass phrase. This will create a id_rsa.pub file in your .ssh folder. 

On the remote server

  1. Log into the remote server. 
  2. Create a .ssh folder if not already present. 
  3. chmod 700 .ssh
  4. cd .ssh
  5. vim authorized_keys
  6. Copy paste the contents of the id_rsa_pub file into the above file. 
  7. save the authorized_keys file 
  8. chmod 700 authorized_keys
  9. exit and try to login again, you will not be prompted for a password. 




0 Comments:

Post a Comment

<< Home