SSH - Prevent SSH Session Timeout

If your SSH session is being timeout (it could be your ssh server or router timeout inactive connection), this could help

SSH obtains configuration data from the following order

1. Command line (eg, ssh host -o "options")
2. User configuration file (eg, ~/.ssh/config)
3. System wide configuration file (eg, /etc/ssh_config for Mac and /etc/ssh/ssh_config for Linux)

We will be focusing on command line

In general, a command to prevent server disconnecting inactive connection is as follow

ssh username@host -o ServerAliveInterval=X

ServerAliveInterval=X where X is in seconds. This option request the client to send a message to server in every X seconds and request a respond from the server.

Example of setting interval request for 60 second

ssh username@host -o ServerAliveInterval=60



Popular posts from this blog

FFMPEG - Creating timelapse with FFMPEG with JPEG

MP4 File Format Part 1