passwordless SSH login

byo71's picture
Communications | Debian Support

need to run scripts on another server but dont want to have to include your passwords in the scripts?
Use RSA logins instead.
This uses a pre-generated set of public RSA keys to authenticate sessions rather than having to enter passwords.

On the machine you wish to log in from:

$ ssh-keygen -t rsa

make sure to leave the passphrase blank!

$ ssh-copy-id -i ~/.ssh/id_rsa.pub username@server

you will be prompted for the user's password to authenticate the key transfer.

This message will appear when the transfer is complete:

"
Now try logging into the machine, with "ssh 'username@server'", and check in:

.ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.
"

Now you have passwordless login working! Now you can just:

$ ssh username@server

and you will be logged in without the remote system asking for a password.

Script away!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.