«

»

Jan 23 2011

How to setup SSH key authentication (passwordless auth)

Hi folks,

This is a quick post to show you the commands you need for setting up SSH keys for easy-peasy, yet very secure authentication between yourself and a Linux/Unix server.  This is fairly straightforward and should be doable by anyone.  Once done, you get added security (provided you turn off password auth on the sshd), and convenience.  It also lets you worry tons less about those pesky script monkies with their ssh dictionary attack botnets.

We’ll start with what you need to do on the client.  You simply need to run ssh-keygen -t rsa.  This creates an id_rsa and id_rsa.pub file in your /$HOME/.ssh folder.   Then you copy the id_rsa.pub to your server, or paste it’s contents into /$HOME/.ssh/authorized_keys.  Then make sure you give that file restrictive permissions, and that’s it, you’re done.

On my ubuntu desktop, it has a key/password management utility built into it such that I enter my password once, and the n move on. until I log out.  Otherwise, you still need to enter the password each time you login using this key.  Granted that password is optional, but I think if you’re looking for ultimate convenience, you’re best off using the utility I mentioned within Ubuntu (or some equivalent) or you can lookinto ssh-agent.

1 ping

  1. Tomboy notes: Great note taking and management app | obsecured.net

    [...] or my virtualization beast at home, I have the same notes available everywhere.   You can look at my post on SSH key-based login to learn how you can enable [...]

Leave a Reply

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>