0

how to fix GCP container optimized os ssh timeout too soon

its /etc/ssh/ssh_config has:

# Google Compute Engine times out connections after 10 minutes of inactivity.
# Keep alive ssh connections by sending a packet every 7 minutes.
ServerAliveInterval 420

but it close connection when idle for around 3 mins

client_loop: send disconnect: Broken pipe

Plus: its /etc/ is not stateful, which means what ever you change will be wipe out after reboot.

C.K.
  • 4,348
  • 29
  • 43

1 Answers1

0

for MacOS set ServerAliveInterval 120 in client's ~/.ssh/config

Host container_optimized_os
  ServerAliveInterval 120
  HostName ipaddr
  Port 22
  User username
  AddKeysToAgent yes
C.K.
  • 4,348
  • 29
  • 43