Friday, May 13, 2016

Linux: SSH login without password

I was writing the custom shell scripts for starting and stopping the remote server and these scripts required to executed on the remote server itself using ssh. Now but everytime you run ssh command it ask for the password to avoid that I use the public key authentication without the pass phrase (well you should always use the pass phrase from the security perspective).

Steps to configure public key authentication

  • Create ssh public and private keys, i.e. run the command ssh-keygen -t rsa
  • Do not give the pass phrase if you do not want to enter password every time you do the ssh.
  • Add Keys to the server by using the command ssh-copy-id username@hostname
  • Enter the password for first time.
  • now connect the machine using ssh, you will directly connected to the machine without passing the password.

No comments:

Post a Comment