Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've created a user called "user". I want this user to be able to login to ssh using an SSH Key.

I have done the following:

  • created a folder called .ssh inside /home/user and chmoded it to 700
  • created a file called authorized_keys inside /home/user/.ssh/ and chmoded it to 600
  • added the public key i generated with puttygen into the authorized_keys file
  • restarted ssh

Now when I try to login to hostname.com with the private key generated with puttygen I get that error server refused our key and disconnected: no supported authentication methods available (server sent: publickey)

When I did this for the user root it worked fine, what am I doing wrong here?

share|improve this question
    
Does user own his home folder and all its contents? –  Dennis Feb 25 at 2:57
    
Yes user owns /home/user and everything inside it –  Kent Feb 25 at 3:56
1  
After giving the user user a password it worked. –  Kent Feb 25 at 4:10

1 Answer 1

PuttyGen usually create a public key starting with:

---- BEGIN SSH2 PUBLIC KEY ----
BBBBBBBojojoj...
---- END SSH2 PUBLIC KEY ----

I solved this opening the key in PuttyGen and copying it from there. It looks like:

ssh-rsa BBBBBBBojojoj...= rsa-key-20140225

After adding this key to the public keys and restarting the server, it should work.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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