Tito Miguel Costa
Refactoring ideas

Avoid password prompt on the command line

Configure ssh to login automatically on a remote server

In case you often connect to remote server and get bored of typing the password all the time, there is a solution.

Create a public key, running the command

$ ssh-keygen -t rsa

A file ~/.ssh/id_rsa.pub will be created with your public key.

Now, publish the key to the server

cat ~/.ssh/id_rsa.pub | ssh USER@DOMAIN.COM "cat >> .ssh/authorized_keys"

And this will be the last time you will be asked for the password. Test if everything went as expect executing


You should login immediately, without being asked for the password.

25 June, 2012
SSH, Bash