Putty + Server refused our key

longhair

Member
Jun 27, 2014
113
0
16
I keep getting the error "Server refused our key" when I try to log in using Putty.

Here is what I have done:

1) Created a new user, logged out and logged in with new user.
2) Created a directory ~/.ssh
3) chmod 700 ~/.ssh
4) ssh-keygen -t rsa -b 4096
5) cat id_rsa.pub >> authorized_keys
6) chmod 600 ~/.ssh/authorized_keys
7) /etc/ssh/sshd_config:
Code:
PermitRootLogin no

RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile
%u/.ssh/authorized_keys
8) sudo service ssh restart
9) Transfered id_rsa to Windows, converted it to .ppk file to be used with Putty.
10) rm ida_rsa and id_rsa.pub
11) exit
12) Log back in only to see Server refused our key.

cat /var/log/auth.log
...
Jun 27 11:46:53 sfh sshd[16217]: pam_unix(sshd:session): session closed for user longhair
Jun 27 11:47:14 sfh sshd[16528]: Accepted password for longhair from x.x.x.x port xx ssh2
...

I couldn't find an answer after searching google for a couple of hours :(
 
That article was where I got the idea to look at the /var/log/auth.log file.

I just tried to make a new key pair (probably the 10th try today) and still being refused.
 
I made a Debian 7 VM with only SSH Server and Standard system utilities. After that I followed the same steps from my original post.

On the first try, the SSH keys worked. Does Proxmox have another public key somewhere that is causing the issues?
 
I made a Debian 7 VM with only SSH Server and Standard system utilities. After that I followed the same steps from my original post.

On the first try, the SSH keys worked. Does Proxmox have another public key somewhere that is causing the issues?

Hi,
no - work for me without trouble.

Are you sure, that you don't have linebreaks in the public key?!

Udo
 
This is strange indeed. I ended up doing a fresh install, created a new user without sudo or anything extra and now it works.

I don't know what caused the issues from the previous install...