Keep my SSH session alive

Posted January 11, 2016 18k views
Linux BasicsDigitalOceanNetworkingLoggingApplicationsLinux Commands

When i leave my session on X2GO or XRDP my firefox is killed but how my firefox can run ?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

To ensure the SSH session does not time out, you would want to edit the /etc/ssh/sshd_config file to ensure these settings are in place:

ClientAliveInterval 30 TCP
KeepAlive yes
ClientAliveCountMax 99999

After making those changes, please be sure to restart your SSH service using the command:

service sshd restart

If you only want to do it on a per session basis, you could just append this flag to your SSH command:

-o ServerAliveInterval=100

Hope it helps!
Jason Colyer
DigitalOcean Platform Support Lead


Shouldn’t it instead be

ClientAliveInterval 30
TCPKeepAlive yes
ClientAliveCountMax 99999