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

前端 未结 15 919
渐次进展
渐次进展 2020-12-08 07:14

I kept getting kicked out of my compute engine instance after a few seconds of idle with the indicated error (255). I used \'gcloud compute ssh\' to log in. I am using t

相关标签:
15条回答
  • 2020-12-08 07:58

    For me, my other teammates were able to login into the machine, but not me. So I asked them to create a user of my name with sudo rights, logged into serial console and changed passwordAuthentication to yes followed by sudo service ssh restart (for few this could be sudo service sshd restart.)

    Post this I was able to login with ssh -o PreferredAuthentications=password username@publicIP -p 22

    This trick worked fine for me.

    0 讨论(0)
  • 2020-12-08 07:59

    IT was my mistake stating that the default firewall would allow all connections into an instance. The contrary turned out to be true. Please refer to an appropriate firewall rule must be set up to allow connection into an instance

    Anh-

    0 讨论(0)
  • 2020-12-08 07:59

    I eventually had to delete my instance and make a new one with the same disk. See https://cloud.google.com/compute/docs/troubleshooting/troubleshooting-ssh#use_your_disk_on_a_new_instance for details.

    0 讨论(0)
  • 2020-12-08 08:01

    I had same issue.

    I had connected the serial control and had checked logs. and there was some error log like "there is no disk space". Then I had resized disk as written in this document.

    Now I am able to connect to instance with ssh.

    0 讨论(0)
  • 2020-12-08 08:02

    had the exact same symptoms - in my case the reason appeared to be the following. I was using root user + ssh key whereas root login is by default disabled in /etc/ssh/sshd_config (PermitRootLogin property).

    0 讨论(0)
  • 2020-12-08 08:04

    This is a real problem with very little documentation to dealing with it.

    Sometime after creating the instance using the gcloud sdk ssh snippet provided via GCP console stopped working and continually errors with 255 making connecting to ssh on the instance only available through browser via GCP console for the compute instance in question. Not to mention this has happened to me on many different instances some without touching the default account permissions after initial setup and deployment which is overly frustrating. Cause for no reason it just stops working...works, then doesn't...

    The only thing that worked for me was creating a new user to connect with through gcloud sdk! Be it Windows/PowerShell or Linux locally, using the following snippet:

    gcloud compute ssh newuser-name@instance-name

    That all per GCP documentation here: https://cloud.google.com/compute/docs/troubleshooting/troubleshooting-ssh

    Everything else passed per suggestions in documentation - port 22 open with access meaning it has to be a a problem with the default users authorization_keys WHICH they provide absolutely no documentation on how to fix that - at least nothing I could find on fixing (not creating or deleting)

    I've tried updating the account, tried deleting the user and credentials from the instance, nothing appears to work. using:

    gcloud compute --project "project-name" ssh --zone "us-east4-a" "instance-name"

    Just doesn't work... - even tried 'gcloud compute config-ssh --force-key-file-overwrite' NOTHING WORKS...

    But creating a new user works every time, and once the user is created you can keep using that user via gcloud sdk

    It's a work around, and I hate work around's for things like this but for my sanity this works at least until I can figure out how to reset the default account permissions, so if anyone has any ideas there or can point me in a direction for that I'd more than appreciate it!

    0 讨论(0)
提交回复
热议问题