1

I decided to try out the Laravel Forge, but I'm having trouble with the SSH keys. I use digitalocean.com for the VMs and have used SSH keys with success many times before.

However when I paste my public key into Forge (which adds it to the server) I'm not able to connect to it. I use Putty and I get the following error:

Disconnected: No supported authentication methods available (server sent: publickey)

Key was generated using puttygen and was added to pageant.

I have tried using the very same key files as my other VM and tried creating a new one, but all without luck.

I'm hoping someone can help me out here.

Edit: here is my putty log http://pastebin.com/ZGmm8Mcv

  • I don't know the putty equivalent but you need to show the output of ssh -vvv. "No Supported authentication methods available" sounds like no public key was sent when trying to connect. – AD7six May 31 '14 at 14:48
  • i updated my question with a log – alysdal May 31 '14 at 15:01
  • Event Log: Trying Pageant key #0 Event Log: Server refused public key - looks like a clear case of the offered key not being accepted. I doubt using laravel forge fundamentally changes how ssh access works - you should IMO debug it like any other ssh access problem (check keys exist on the server, check they match the key being offered). – AD7six May 31 '14 at 15:05
1

The answer from @alysdal worked perfectly for me. Just to have the steps on this site as well:

You have to modify your public key and transform your generated key from this form

---- BEGIN SSH2 PUBLIC KEY ----
Comment: "rsa-key-20160907"
AAAAB3NzaC1yc2EAAAABJQAAAIEA3nfXA8oSOGcx1OJg0/2dkgH2gDXhN6GX5/QW
KyPif8tHYh/GBvwsnoLyPAUNq9D9wv/g+DxBr1nGpIwIAICxycHNEq7iNGcImhWs
rlEWBWRE8fYG4Qpx0/CKDcNsCZzjiu0exwp4pw5nDcZQOsr321bly3edRgfgmgix
rzLaOCk=
---- END SSH2 PUBLIC KEY ----

into this form

ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEA3nfXA8oSOGcx1OJg0/2dkgH2gDXhN6GX5/QWKyPif8tHYh/GBvwsnoLyPAUNq9D9wv/g+DxBr1nGpIwIAICxycHNEq7iNGcImhWsrlEWBWRE8fYG4Qpx0/CKDcNsCZzjiu0exwp4pw5nDcZQOsr321bly3edRgfgmgixrzLaOCk= user@host

which means:

  1. Remove first two lines and the last line.
  2. Join the remaining lines into one single line without whitespaces
  3. Insert ssh-rsa with one trailing space at the beginning of the file
  4. Optional: You can append <user>@<host> at the end of the file preceded with a whitespace.
2

Turns out putty and openssh have incompatibilities. I modified my ssh key according to they following guide and it now work seamlessly.

How To Fix “Server Refused Our Key” Error That Caused By Putty Generated RSA Public Key

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.