0%

How to keep ssh sessions alive

How to keep ssh sessions alive

Command option

1
ssh -o ServerAliveInterval=120 john@example.com

Config client file option

1
2
3
4
5
6
7
8
9
10
# ~/.ssh/config
# "ServerAliveInterval" will send a “null packet” every 120 seconds on your SSH connections to keep them alive.
# For all hosts (Good)
ServerAliveInterval 120
# For a selection of hosts
Host example.com example2.com
ServerAliveInterval 120