SSH Keys Auth how to....
Posts: 486
This is my first how to, so be easy.
What I did was get sshd working with rsa key authenication.
I used putty.exe, puttygen.exe, and pageant.exe, these can be downloaded @ http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
First I got ssh to work using keyboard authenication, basically, Mepis out of box, after firewall is opened, ssh will work using keyboard auth. BTW, my server is Mepis Linux and my client is M$ XP.
After that I used puttygen.exe (on XP) and hit generate key. Next I entered a passphrase (needs to be STRONG) and I also changed "key comment" (although not neccessary) and saved public key as "c:\public" and private as "c:\private.ppk" also, my putty.exe is in c:\.
I then copied the public key text in puttygen window by selecting text and copying all text in window.
Next on server in /home/"user"/.ssh/ I created a file called "authorized_keys" and pasted contents I got from puttygen. I had to do this using konquerer, couldn't access ~.ssh from ssh client (or any other "hidden" file for that matter??) And saved.
Next back to client (XP) I opened pageant.exe, it had a icon in system bar next to clock. I clcked it and hit the "add key" button. I then selected "c:\private.ppk" and it prompted for the passphrase, entered that and pageant is done. Leave pageant open.
Now when putty.exe is used and the user that is same as user /home/"user"/.ssh is used at login prompt, keys should be transferred and let you in.
So to sum up, after once setup, and pageant is running, putty can be ran and no password or passphrase is needed. Or if pageant is not running, putty alone has an entry where a key can be added (which is c:\private.ppk")It is called "connection-ssh-auth". You will then have to enter passphrase every time then.
Keys are safer b/c private signatures are generated at every connection, unlike password where same password is entered every time. (If a more better explanation, please post
)
Thanks,
Travis