--
© 2018 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
Email preferences: You received this email because you signed up for the Google Compute Engine Discussion Google Group (gce-dis...@googlegroups.com) to participate in discussions with other members of the Google Compute Engine community and the Google Compute Engine Team.
---
You received this message because you are subscribed to the Google Groups "gce-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gce-discussio...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gce-discussion/4df58ce2-2857-4a07-837a-8c418e67add9n%40googlegroups.com.
Troubleshooting Steps:
TIP: Return Code 255 is perfectly normal if the SSH session was terminated (for example, if you issued sudo reboot now). Code 255 usually results when SSH intentionally terminates a session and prevent user access due to errors (wrong permission on ./ssh/authorized_keys, authentication, etc), or simply the service is not reachable.
Wait a few minutes and try again. It is possible that:
Make sure that the user has authenticated to gcloud as an IAM user with the compute instance admin role; for example, run gcloud auth revoke --all, gcloud auth login [IAM-USER] then try gcloud compute ssh again.
Logon using UI ssh. This creates an ephemeral ssh key, Google Agent also executes the codepath to refresh .ssh/authorized_keys and address any invalid dir/file permissions for both .ssh/ and .ssh/authorized_keys. This approach will address common gcloud compute ssh issues that relates to corrupted keys, missing dir/file or invalid dir/file permission. Try the gcloud again after performing the UI ssh.
Force gcloud to recreate the user's SSH key pair then try gcloud compute ssh again. Move the existing key pair aside using these commands:
mv ~/.ssh/google_compute_engine ~/.ssh/old-google_compute_engine mv ~/.ssh/google_compute_engine.pub ~/.ssh/old-google_compute_engine.pubVerify that SSH access to the instance is not blocked by a firewall.
Make sure that the root volume is not out of disk space.
Make sure that the instance has not run out of memory.
Make sure the VM has started up successfully. Look for status in the serial console logs. If there are boot issues, they can be fixed by steps here.
Verify that persistent SSH Keys metadata for gcloud is set for either the project or instance.
Authentication issues are logged in to /var/log/auth*.log, review this log for any errors. If this file can't be access due to inability to logon to the VM, this require detaching and attaching the boot disk to another VM in order to review the logs.