Monday, January 30, 2006

OpenSSH Public Key Authentication

So... I had to setup my first SSH public key auth today. The link below is a great tutorial for setting it up on both the client and server ends. However, it should be noted, and I found out the hard way, is that when using a win32 client like Putty or SecureCRT, they export their keys into a format that has to be run through ssh-keygen, and not just appended to the "~/.ssh/authorized_keys" file.

The easy way to tell the difference is a key generated by one of the aforementioned win32 progs, will start with:

---- BEGIN SSH2 PUBLIC KEY ----

A key that doesn't need to be processed will start like:

ssh-dss AAAAB3NzaC1kc3MA

To convert a key to the correct one:

ssh-keygen -i -f securecrt.pub >> authorized_keys

OpenSSH Public Key Authentication