Last Updated: February 25, 2016
·
1.411K
· kewitz

SSH and SCP without passwords

1. On the client machine

ssh-keygen -t dsa

...now copy the ~/.ssh/id_dsa.pub file to the server using:

scp ~/.ssh/id_dsa.pub user@servermachine:public_key.tmp

2. Now, on the server machine you have to add the key to the end of the ~/.ssh/authorized_keys file, you may do this using:

cat ~/public_key.tmp >> ~/.ssh/authorized_keys
rm ~/public_key.tmp

Obs. If you don't have the .ssh on your home folder at your servermachine, create it before step 2 using:

mkdir .ssh
chmod 700 .ssh

3 Responses
Add your response

On Linux you can use ssh-copy-id to install your public key in a remote machine's authorized_keys.

over 1 year ago ·

I believe it should still be password protect along with this method.
So using this plus password.

over 1 year ago ·

For sure, you should always password protect your private key.

over 1 year ago ·