tcpdump.png

Increase Linux SSH Connection Timeout Quick Guide

Updated: Jun 14

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
EOF

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

TMOUT=600
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.




69 views

Join our newsletter! Get a free cloud server!  Never miss a post!

Thanks for submitting!