2009-04-05

Password-less SSH login (auto-authentication/login) on a remote machine

ssh-keygen -t rsa

...will generate an id_rsa and an id_rsa.pub file in your ~/.ssh/ directory. Afterwards you have to copy your id_rsa.pub file which is basically your public key, to the ~/.ssh/authorized_keys file on the remote machine. So if you copy the id_rsa file to the /root/.ssh/authorized_keys file of a remote (or local...) machine, you should be able to log-in on this machine as root without providing any password:
scp ~/.ssh/id_rsa.pub root@example.com:/root/.ssh/authorized_keys
or
scp ~/.ssh/id_rsa.pub anyUser@example.com:/home/anyUser/.ssh/authorized_keys
Also you should pay attention NOT to copy the ~/.ssh/id_rsa file, as this is your private key which should be kept secret. However an auto-login resp. auto-authentication which allows you to login on a remote machine without entering a password might decrease the security level of the remote machine: So if anybody get your private id_rsa key, he is able to auto-login on this machine as well.