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
255 is the interactive ssh exit code for ssh failure - otherwise interactive ssh exits with the exit code of the last command executed in the ssh session.
The next time you get exit code 255 from ssh try running with --ssh-flag="-vvv" (more v's => more debugging output) and see if it helps track down connection problems.