How to enable Permission denied (publickey, gssapi-keyex, gssapi-with-mic)?

This question may have been asked before, but I do not understand this concept. Could you help me here?

A strange problem from this morning .. I see that I'm just pushing my file to Google Cloud Computing, showing the error below. I do not know where to look for this error.

ri@ri-desktop :~$ gcloud compute --project "project" ssh --zone "europe-west1-b" "instance" Warning: Permanently added '192.xx.xx.xx' (ECDSA) to the list of known hosts. Permission denied (publickey,gssapi-keyex,gssapi-with-mic). ERROR: (gcloud.compute.ssh) [/usr/bin/ssh] exited with return code [255]. 
+7
ssh centos google-compute-engine gcloud
source share
2 answers

One possible reason is that someone in your project has set metadata for each instance for sshKeys (which overrides the project metadata). When you run gcloud compute instances describe your-instance-name , do you see a key called sshKeys in the metadata element?

It would also be useful to see the contents of the last log in ~/.config/gcloud/logs/ . However, please be sure to clear it of confidential information.

+6
source share

This happens when your compute instance has PermitRootLogin no in its SSHD configuration and you try to log in as root. You can change the login user by adding username@ before the instance name. Here is a complete example:

 gcloud compute instances create my-demo-compute \ --zone us-central1-f \ --machine-type f1-micro \ --image-project debian-cloud \ --image-family debian-8 \ --boot-disk-size=10GB gcloud --quiet compute ssh user@hostname --zone us-central1-f 

In the above example, gcloud will install the correct credentials and be sure to log in. You can add --quiet to ignore the ssh-password issue.

+3
source share

All Articles