0

I could do SSH & SFTP from a windows 7 laptop to my Google Compute Engine instance until I changed my laptop & also upgraded to Windows 10. In the event I lost my previous settings, so had to start it all over again. I followed the steps provided from below but couldn't succeed -

Cannot connect to Compute Engine instance via SSH

https://cloud.google.com/compute/docs/console#sshkeys

Unable to SSH to Google Cloud

My setup is same with just one change that my local machine is running on Windows 10.

I used gcloud sdk on windows 10, which updates the first time generated public key by itself onto my cloud instance, I could verify that also.

But the login from both gcloud & Putty fails with the error code "Disconnected: No supported authentication methods available(server sent: publickey)".

However, I could login successfully through the Web SSH.

What could be the issue?

It is that I have to use my gmail account/email only (in some specific format) while generating the keys? or Windows 10 SDK compatibility issue? or something else?

  • What do the sshd logs on your server say? – Iain Aug 10 '15 at 11:37
  • cat /var/log/auth.log|grep ssh shows the following..repeatedly.. Aug 9 10:27:57 test sshd[24084]: error: Could not load host key: /etc/ssh/ssh_host_ed25519_key Aug 9 10:28:00 test sshd[24084]: error: Received disconnect from 122.172.161.25: 14: No supported authentication methods available [preauth] – Ashutosh Agrawal Aug 10 '15 at 12:32
  • So now you have an error message you have something to work on. I'll let you do just that. – Iain Aug 10 '15 at 13:12
  • On your windows 10 machine you can open your key in a text editor notepad or notepad++ to make sure your key is properly formatted remove extra spaces or blank lines. Moreover, have you copied the public key created for windows 10 user to GCE instance authorize_keys file or to GCE metadata server ? – Faizan Aug 11 '15 at 21:49
  • 1
    if your keys are in the project metadata it should sync with all the instances in your project. There is a script google-adress-manager(github.com/GoogleCloudPlatform/compute-image-packages/blob/…) running on the instance which is responsible to sync all the accounts and keys. Can you check if that script in running on your vm ? You also can try to copy the keys to /etc/authorized_keys to see if that works for you. – Faizan Aug 14 '15 at 21:43
1

OP has resolved this issue by copying his SSH keys to authorized_keys file. This issue can be caused if Google accounts daemon is not running on your VM. This daemon is responsible for syncing ssh keys and user account information between the metadata and VM. For more information on accounts daemon you can visit this link.

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.