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 id_dsa.pub 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/id_dsa.pub [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 id_dsa.pub >> .ssh/authorized_keys 

More reading:

http://ubuntu-tutorials.com/2007/02/05/unattended-ssh-login-public-key-ssh-authorization-ssh-automatic-login/

http://wiki.amahi.org/index.php/Key-based_SSH_Logins_With_Putty

http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-ssh-copy-id/

 http://olex.openlogic.com/wazi/2011/shh-openssh-secrets-here

 

Bookmark the permalink.