I've been trying to set up public key/private key logins and being unsuccessful at it. I've been following a guide that may/may not be incomplete. I did the following:
- Generated a public/private key pair with puttygen.
- Uploaded the public key to the server
- Moved that public key to
/home/user_name/.ssh/authorized_keys
- Set up putty to use key auth
When I then attempt to log in I get the message
The server has refused our key
Have I done something wrong?
You need some special format when you use putty.
You should look at the logs:
/var/log/auth
to find out what happened what is preventing your logon. It is usually permission problem or line breaks in the key (it should be all in one line) or in the case of putty wrong key format.It is possible to use a RSA key generated by puttygen.
Here's a video tutorial on how to use your RSA key from puttygen with openssh. It is pretty straightforward to follow.
there is a good chance the permissions on your ~/.ssh folder, or your home directory itself are too loose.
The key gotcha I've come across is the file permissions on the
~/.ssh/
directory - it should not be group or world readable or ssh will not use it. However if you create the directory manually then it won't have the correct permissions. The command to use to change the directory to have the correct permissions is: