See GOOGLE COMPUTE ENGINE(GCE)注册开VPS教程

FAQ

Google Cloud ssh timeout: how to increase session time?

Google Cloud ssh timeout: how to increase session time? - Stack Overflow

See Tips, Troubleshooting, & Known Issues

MAC:

1
sudo sysctl -w net.inet.tcp.always_keepalive=1 net.inet.tcp.keepidle=60000 net.inet.tcp.keepinit=60000 net.inet.tcp.keepintvl=60000

macos - How can I prevent an SSH session from hanging in OS X Terminal? - Ask Different

You can:

Configure your system, system-wide, for all connections
By editing: /etc/ssh/ssh_config
And add the line:

1
ServerAliveInterval 10

Or, per-server ~/.ssh/config

1
2
Host keepsdroppingme.com
ServerAliveInterval 10