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
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.