Increase Linux SSH Connection Timeout Quick Guide

Updated: Mar 18

In this tutorial, we will learn how to increase SSH Connection Timeout value in Linux.

Here are the steps to increase SSH connection timeout.

  1. Create a user ssh configuration file if it doesn't exist on the client

  2. Add two lines to file ~/.ssh/config on the client

  3. Change the user timeout value through the TMOUT variable on the server

  4. Check TMOUT value on the server

These are the commands we can run on the client-side.

touch ~/.ssh/config 
cat << EOF >>  ~/.ssh/config 
host *
    ServerAliveInterval 20

The following are the commands we need run on the server-side.

export TMOUT
echo $TMOUT

Now the current ssh connection timeout is 10 minutes (600 seconds). We can increase this value if needed.

We can check the detailed info about how to increase SSH timeout value in Linux here.


Join our newsletter. Get a free Linux account on Cloud.

Never miss a post!

Want a free Linux account?  This account can be used to login to our cloud server and practice Linux commands.


✔ Linux Commands   ✔ Linux Skills    ✔ LinuxPerformance   ✔ Linux Interview

Some articles are from the public internet. If you find your article misused or undesired here and you don't want us to display it, please let us know and we'll remove it immediately.