Host keeps asking for password when using SSH Keys with PuTTY for Windows
I'm using PuTTY for Windows to connect to dreamcompute-VPS(dreamhost). At dreamcompute panel, I created a private key and downloaded it, a .pem file. Using PuTTYgen, I converted this file to .ppk as SSH2-RSA. So, I downloaded Pageant.exe and added this .ppk file. At PuTTY.exe, I put as Host Name the floating IP gotten from dreamcompute panel, set the username at Connection->Data
as dhc-user and, finally, loaded the .ppk file at Connection->SSH->Auth
. The problem is when I open the connection, the authentication process keeps asking me for password. What am I missing? Shouldn't It be only username and keys?
Log:
=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2015.07.21 15:08:26 =~=~=~=~=~=~=~=~=~=~=~=
Event Log: Writing new session log (SSH raw data mode) to file: C:\Users\User\Desktop\putty.log
Event Log: Looking up host "173.236.254.75"
Event Log: Connecting to 173.236.254.75 port 22
Event Log: Server version: SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
Event Log: We believe remote version has SSH-2 channel request bug
Event Log: Using SSH protocol version 2
Event Log: We claim version: SSH-2.0-PuTTY_Release_0.64
Event Log: Doing Diffie-Hellman group exchange
Event Log: Initialised AES-256 SDCTR client->server encryption
Event Log: Initialised HMAC-SHA-256 client->server MAC algorithm
Event Log: Initialised AES-256 SDCTR server->client encryption
Event Log: Initialised HMAC-SHA-256 server->client MAC algorithm
Event Log: Reading private key file "C:\Users\User\Desktop\private.ppk"
Event Log: Pageant is running. Requesting keys.
Event Log: Pageant has 1 SSH-2 keys
Event Log: Pageant key #0 matches configured key file
Event Log: Trying Pageant key #0
Event Log: Server refused our key
Solution 1:
The main issue is here:
Event Log: Server refused our key
This can be caused by incorrect permissions on .ssh/authorized_keys
, or an invalid key.
The permission can be solved using this:
chmod -R go-rwx ~/.ssh
The other possibility is the wrong key. You must append the public key on ~/.ssh/authorized_keys, not the private key. Check if the correct key is there.