If you would like to connect to your machine through ssh without being asked for a password you should do this.

  1. Create a public/private key pair
  2. ssh-keygen -t rsa

    Please Do not forget not to write any passphrase, just empty for no passphrase for this to work
  3. Copy te file id_rsa.pub to the $HOME/.ssh directory of the machine you wish to connect to, where $HOME is the directory of the user you would like to connect as. /root/.ssh in the case you would like to connect as root. Consider you would like to connect as the user user
  4. scp $HOME/.ssh/id_rsa.pub usuario@server.remoto:/home/user/.ssh/authorized_keys2


    ssh-copy-id -i ~/.ssh/id_rsa.pub username@example.com

  5. Now you can connect to the remote server with out being asked for a password.
  6. ssh -l usuario server.remoto