SSH logins with keys

Quick and dirty way to do this is to obviously first Install SSH key onto server and then:

On client:

 ssh-keygen -t dsa 

Then get the key over to the server or remote machine that only accepts SSH key logins, you can do that with ssh-copy-id or use your preferred method. Using ssh-copy-id you can issue:

 ssh-copy-id -i .ssh/ [email protected] 

That’s it! You should now be able to ssh into the remote server without a password and you can lock it down further by turning off password authentications by changing ‘PasswordAuthentication yes’ in the sshd_config file to ‘PasswordAuthentication no’ – just be CAREFUL doing this as you could stop access for others or lock yourself out.

Or on the server:

 cat >> .ssh/authorized_keys 

More reading:


Bookmark the permalink.