4

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
João Paulo
  • 145
  • 1
  • 6
  • 1
    please, provide log generated by putty to investigate if this key is even used/tried. – Jakuje Jul 21 '15 at 18:05
  • Try the other way around, create the SSH key on Windows using puttygen and upload that key on DreamCompute panel. Full instructions on https://help.dreamhost.com/hc/en-us/articles/216201547-Connect-to-your-instance-with-ssh-keys – Stefano Maffulli Aug 15 '16 at 22:08

1 Answers1

7

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.

ThoriumBR
  • 5,272
  • 2
  • 23
  • 34
  • Here in the panel, there's this instance thing (I don't know whats an instance :D). There, is associated a key pair that I'm not using to login, is that could be the problem? – João Paulo Jul 21 '15 at 19:00
  • 1
    Yes, it can be the problem. You must use the keys the instance gives you. Or you must put the key you are trying to use on `~/.ssh/authorized_keys`. – ThoriumBR Jul 21 '15 at 19:28
  • Thanks for your help! I'll try to solve it. I'm gonna see if I solve this instance thing. I don't know how to manage the `.shh` folder cause I can't even connect to server. – João Paulo Jul 21 '15 at 19:37