0

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 dsl-xxx-xxx-xxx-xxx-dyn.prod-ISPDOMAIN.com [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.

5
  • 1. Is it (your public key) all one line? 2. Post your /var/log/auth.log? Commented Sep 12, 2012 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 Commented Sep 12, 2012 at 15:52
  • Ah! And maybe the key length is not enough for your ssh server. I would advise never less than 1024 bits. Commented Sep 12, 2012 at 15:53
  • I have successfully done modifying the puttygen public key to suit openSSH --> how did you edit your public key for compatibility with ssh-keygen? Commented Sep 12, 2012 at 16:08
  • following this: walkernews.net/2009/03/22/…, basically just trim the key into one line Commented Sep 12, 2012 at 16:12

1 Answer 1

3

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 > ssh-keygen.pub 

UPDATE

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

enter image description here

6
  • I got "uudecode failed." message O_o Commented Sep 12, 2012 at 16:19
  • sounds like it is already in OpenSSH format or your public key has DOS-style line break. Commented Sep 12, 2012 at 16:25
  • @Kossel: updated my question. Commented Sep 12, 2012 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? Commented Sep 12, 2012 at 16:40
  • 3
    You mean on the server? If so, it must be authorized_keys. Commented Sep 12, 2012 at 16:43

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.