简体   繁体   中英

Permission denied (publickey). - I can't login to my VM on Google Cloud Platform

I created a vm on google cloud platform and I can't login by ssh anymore into that VM.

So I ran that command in the cloudshell :

gcloud compute ssh user@vm

And I got the following output :

Permission denied (publickey). ERROR: (gcloud.compute.ssh) [/usr/bin/ssh] exited with return code [255].

When I connect using the datalab it works :

gcloud compute ssh datalab@vm 

And I can see the files on the vm through the google cloud shell

There are another users who can connect to this VM with their own user account and not just by using the datalab user.

So maybe it would be more efficient if they were running commands with their account to help me solve that problem ? (by giving me more rights for example)

I tried to fix the problem by reading the answers to some questions that seems similar but it didn't solve the problem.

Do you have an idea what the problem is ? Thank you very much for your answers.

Please follow the troubleshooting in this Stack link , especially the one that says remove the SSH key for the server (in your GCE Metadata page) and run the gcloud command again.

If none of them works, you can try running the gcloud command with --ssh-flag="-vvv" to track the root cause of the issue. If you post any further output here, please make sure to remove private information first.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM