Windows – PuTTY/SSH: How to Prevent Auto-Logout

logoutputtysshwindows

My ISP's SSH server (Debian 2.0) logs me out after 35 minutes of inactivity, when connected with PuTTY (Windows XP). This is a big problem when I utilize the server for port-forwarding. The final messages displayed in the terminal:

This terminal has been idle 30 minutes. If it remains idle
for 5 more minutes it will be logged out by the system.

Logged out by the system.

PuTTY options that do not help:

  • Sending of null packets to keep session active. Seconds between keepalives (0 to turn off): 30
  • [x] Enable TCP keepalives (SO_KEEPALIVE option)

Any idea how to avoid the auto-log-out? Should I try another SSH client?

Best Answer

  • When you need only port forwarding, you can try if you disable starting a shell at all, and disable allocating a pseudo-terminal. Then the terminal can no longer be idle. :-)

    If your ISP does not allow this, you can run a script like this in your shell session

    while sleep 60; do
        echo "Still there"
    done
    

    so that the terminal shows activity and it should not be logged out.

    But it depends on the operating system they are using which option will help. You did not tell us, did you? uname -a is your friend.