Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I successfully added a rsa key my root account. since I don't want everything in my root acc, I created a new user. but for some how, I keep getting "server refuses our keys" message :S

I did following command with my root acc:

adduser kossel
usermod -a -G sudo kossel
groups kossel
mkdir /home/kossel/.ssh
vi /home/kossel/.ssh/authorized_keys

//I pasted the key in this format "ssh-rsa xxxxxxxxxxxxxx==" for putty openSSH compatibility reason

chown -R kossel:kossel /home/kossel/.ssh
chmod 700 /home/kossel/.ssh
chmod 600 /home/kossel/.ssh/authorized_keys

am I missing something?

update: answering comments: I have successfully done modifying the puttygen public key to suit openSSH, because my root acc is working.

I checked /var/log/auth.log the only message i got is:

Sep 12 15:59:40 9port sshd[7714]: pam_unix(sshd:session): session closed for user kossel
Sep 12 15:59:52 9port sshd[7739]: reverse mapping checking getaddrinfo for [my_ip_address] failed - POSSIBLE BREAK-IN ATTEMPT!

ps: and I also got some spam user already trying to login?? sorry I just started to use vps yesterday.

share|improve this question
1. Is it (your public key) all one line? 2. Post your /var/log/auth.log? – quanta Sep 12 '12 at 15:50
it looks like the format of keys is not recognized by your SSH server... I've heard something about Putty SSH keys which need to be converted to an appropriate format, although I have never had such trouble with my putty clients/linux servers. I have then never done any change from putty keys for openssh compaibility. Can you post your /var/log/auth.log while attempting to perform a connection? One more point: usually the format is ssh-rsa xxxx user@machine, the '==' are part of the key – philippe Sep 12 '12 at 15:52
Ah! And maybe the key length is not enough for your ssh server. I would advise never less than 1024 bits. – philippe Sep 12 '12 at 15:53
thanks for all replay, I updated the question! – Kossel Sep 12 '12 at 16:06
I have successfully done modifying the puttygen public key to suit openSSH --> how did you edit your public key for compatibility with ssh-keygen? – quanta Sep 12 '12 at 16:08
up vote 3 down vote accepted

Try copying your original public key normally (that generated by puttygen), and then convert it to an OpenSSH compatible format:

ssh-keygen -i -f puttygen.ppk >


puttygen supports exporting your key to an OpenSSH format, try this:

enter image description here

share|improve this answer
I got "uudecode failed." message O_o – Kossel Sep 12 '12 at 16:19
sounds like it is already in OpenSSH format or your public key has DOS-style line break. – quanta Sep 12 '12 at 16:25
@Kossel: updated my question. – quanta Sep 12 '12 at 16:33
does the public key has to be some specific name like "Authorized keys" or it can be any just under ~/.ssh folder? – Kossel Sep 12 '12 at 16:40
You mean on the server? If so, it must be authorized_keys. – quanta Sep 12 '12 at 16:43

Your Answer


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.