My Ubuntu18 VMs come up with the following default config in /etc/ssh/sshd_config upon deployment, which makes my ssh sessions into them terminate upon 5min inactivity:
ClientAliveInterval 300
ClientAliveCountMax 0
Which exactly configuration do I add into my cloud_init.cfg to have them all deployed with much higher values? Security is not a concern.
Update: Adding this into cloud_init.cfg seems to fix the issue for Ubuntu16 and Ubuntu18 as my idle ssh session lasts >5min:
write_files:
- path: /etc/ssh/sshd_config
content: |
ClientAliveInterval 30000
ClientAliveCountMax 50
However all other parameters normally present in the /etc/ssh/sshd_config file are lost. Is there an equivalent of this sshd config file residing elsewhere by chance, and if so what's the full path and filename and how do I make just those 2 values in it edited leaving everything else intact?
Many thanks in advance!