SSH login without password

Surely, If you manage servers, you will need to access this system directly without them asking for password.

You can get it with public and private keys, exchanging them previously.

In this howto, CLIENT will be who want to connect and SERVER will be where you want to connect.

Steps in client:

$ ssh-keygen -t rsa
$ scp $HOME/.ssh/id_rsa.pub USER@SERVER:/tmp

The “ssh-keygen -t rsa” command has to be run only one time. If you want to connect more than one server with the same user, you don’t have to run it again.

USER: A remote user in the server where you want to connect.

SERVER: The server where you want to connect.

After “scp” command, you will be asked for the remote user password.

Steps in server:

$ cat /tmp/id_rsa.pub >> $HOME/.ssh/authorized_keys && rm /tmp/id_rsa.pub && chmod 0600 $HOME/.ssh/authorized_keys

Now if you ┬áconnect from CLIENT to SERVER you won’t be asked by the password:

$ ssh USER@SERVER