- Most ssh login/shell connections to servers will timeout and you will have to login again and again.
- To avoid these and keep the shell connection alive for longer, try these steps
- The steps were initially discussed here -> https://unix.stackexchange.com/questions/200239/how-can-i-keep-my-ssh-sessions-from-freezing
- edit
/etc/ssh/ssh
- you will need
sudo
credentials and/or permissions - add the following lines where appropriate
Host *
ServerAliveInterval 100
- save and close
- restart ssh session or client
- edit
/etc/ssh/sshd_config
- you will need
sudo
credentials and/or permissions - add the following lines where appropriate or uncomment if they are already present
ClientAliveInterval 60
TCPKeepAlive yes
ClientAliveCountMax 10000
- save and close
- restart ssh server
service sshd restart
orservice ssh restart