Skip to content

Instantly share code, notes, and snippets.

@rosdyana
Created March 18, 2018 03:33
Show Gist options
  • Save rosdyana/c56f2f221298319d0292399820b8f248 to your computer and use it in GitHub Desktop.
Save rosdyana/c56f2f221298319d0292399820b8f248 to your computer and use it in GitHub Desktop.
keep ssh alive when idle

Client Side

modify

/etc/ssh/ssh_config

add this configuration

Host *
ServerAliveInterval 100

Server side

modify

/etc/ssh/sshd_config

then add this configuration

ClientAliveInterval 60
TCPKeepAlive yes
ClientAliveCountMax 10000

Finally restart the ssh server

service ssh restart or service sshd restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment