really hope you can help me here, i have a 12.04 server and a linux pc at home which i set up ssh keygen for with no problems, i want to now gain laptop entry to the server [win7] using putty, i have made the private key and public one, copy and pasted the public one to a new file called authorized_keys2 and moved that file into .ssh/authorized_keys .. before i did that i sudo chmod 600 authorized_keys2

Then put the key private key into pageant started putty put host name in etc, and its not working, i know or feel i missing permission here or something clearly not set right, anyone share any thoughts on this? After 3 failed login,s i get locked out by Fail2ban, which i happy with, its working. lol Or at least i hope thats all thats wrong, at the minute i cant gain entry, will wait 10 mins before trying , been reading a lot on how to do this, but no one says it clearly for using a second key through putty. Thanks people, look forward to your reply.


You'll have to generate a key using PuTTYgen, because PuTTY uses a different key format.

You can also convert an existing OpenSSH format key. See here.

I suggest to do the first approach. You should never have to move private keys around, unless you're taking backups, in my opinion.

  • hi thanks for your reply, yea i made the keys using puttygen, and have the public key on usb and loaded into the server /etc/known_hosts .. no work, i even tried putting into /ssh/authotized_keys, no work.. i then made a new file called authorized_keys2 and chmod 600, then mv to /ssh/authotized_keys, this of course was a bad move, it over ride the key in there and locked me out of server, after 2 hours work i got it removed and new key set set up using keygen on my tower pc, back to where i started now. Where does the public key go that puttygen made? I lost on this. – jamjam Dec 6 '12 at 16:14
  • @jamjam Make sure you export the public key in OpenSSH format and put this in /home/user/.ssh/authorized_keys. Recursively set permissions correct: chown -R user:user /home/user/.ssh and chmod -R go-rwx /home/user/.ssh. OpenSSH server is quite picky on this. Also make sure to check var/log/auth.log for errors on this level. – gertvdijk Dec 6 '12 at 16:17
  • Please remember this is the second key, first key works fine and sits in .ssh/authorized_keys i not do this.. chmod -R jamjam:jamjam go-rwx~/.ssh i have however chmod -R jamjam:jamjam .ssh chmod 700 .ssh chmod 600 .shh/authorized_keys and my pc tower key works fine, please if we could start with where the key goes, do i have to put it into .ssh/authorized_keys and then set the permission up right by doing chmod -R go-rwx /home/user/.ssh?? Thanks for helping me hey, need it. lol – jamjam Dec 6 '12 at 16:29
  • Back again, checked permission on the .ssh/ i got drwx------ – jamjam Dec 6 '12 at 16:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.