Every time I try to enter via SSH into my VM instance in Google Compute Engine I got this error:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
I have attempted the steps mentioned below :
Generated a ssh key using the command ssh-keygen -t rsa -f ~/.ssh/[filename] -C [username]
Copied the public key into instance ssh list.
What could be the issue or am I missing some steps?
I just had this issue when trying to connect. I changed "enable-oslogin TRUE" to "enable-oslogin FALSE" in the metadata and it started working again.
Ensure that after creating the key it has been copied correctly into the VM Instance. Sometimes during the copying of the key, either tabs, spaces or other indentation may be added into the key which will result in the key being different from the original one that was created. This is a very common failure reason. It is just not good enough to cat the key file and copy whatever you see. You have to ensure that you have copied the key without tabs, spaces or other indentation that may be added.
Double check that during the connection, with the -i option, you’re using the correct private key.
Use the -v, -vv, or -vvv options with your ssh command to further troubleshoot the issue. These options allow various verbosity levels to be activated during the ssh connection which helps in troubleshooting the issue and see exactly where the problem is.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With