I am trying to follow a simple process of ssh'ing to the instance that is described here.
Unfortunately I keep getting this error:
Server refused our key FATAL
ERROR: Disconnected: No supported authentication methods available
(server sent: publickey)
It looks like I do everything correctly.
- I create an new ubuntu instanse
- Try to log in using
$ gcloud compute username@ssh example-instance --zone us-central1-a
Getting a warning that ssh key is going to be generated
WARNING: You do not have an SSH key for Google Compute Engine.
WARNING: [C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\sdk\winkeygen.exe] will be executed to generate a key.
Updated [https://www.googleapis.com/compute/v1/projects/sharp-kayak-120708].
I get the error mentioned above
Server refused our key
FATAL ERROR: Disconnected: No supported authentication methods available (server sent: publickey)
I see the keys created on both, local machine and instance (gcloud adds them to Metadata -> SSH keys). SSH is allowed in network settings.
I have tried an alternative route described here:
- generate ssh using gcloud
- add it to pageant
- SSH using PuTTY
same error:
No supported authentication methods available
(server sent: publickey)
Would really appreciate your ideas.
Thanks for the reports.
The problem is fixed in Cloud SDK Release 98.0.0. It includes remediation that recognizes corrupt Windows key files and regenerates them on the fly.
The problem was in google-cloud-sdk\bin\sdk\winkeygen.exe. It botched the public key modulus representation in the generated .ppk and .pub files. The ssh server then interpreted the modulus as a signed bignum and bailed.
Thanks to George for assistance with work around: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!topic/gce-discussion/uAPNpkBJXi4
Step by step guide here:
- Download PuTTY and PuTTYgen.
- Generate a key with PuTTYgen. Replace the text in the comment box with your windows username. Copy and paste the code from the window into SSH keys for the project AND for the instance (go to instance, edit, scroll down to SSH key list and click "add") (not sure if both are necessary). Don't use a pass phrase.
- Also, save as private key file. For convenience save it in your C:\Users\.ssh folder. PuTTY will need this format of key to work.
- Open PuTTY. Add the key to the session: Connection>SSH>Auth>Browse.. point at the newly generated key file you just made in .ssh.
- Set up the session. Enter IP address. Worth saving at this point - it will remember the IP and key.
- Open...
- Log in as:... enter your Windows username that you added as the comment in the key gen.
I'm now up and running! Looking forward to a fix that lets the "google compute ssh command work! Bug report: https://code.google.com/p/google-cloud-sdk/issues/detail?id=546