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?

link|improve this question

70% accept rate
... Debian 2.0? – grawity Jun 20 '10 at 12:22
feedback

2 Answers

up vote 0 down vote accepted

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.

link|improve this answer
Not allocating a pseudo-terminal seems to indeed prevent the auto-logout, at least in a first test. Thanks for the simple solution! BTW, I did tell you about the system. See my question. – feklee Jun 21 '10 at 8:51
feedback

That looks like the server is enforcing the timeout at the protocol level, and explicitly ignoring the null packets often used to keep a connection alive despite such timeouts. Unfortunately that means there is probably little you can do via client options.

You could try arrange for something in the session to be constantly updating, perhaps by using screen and arranging for an updating clock to be in the status bar as seen in this example. If that clock display doesn't update without user input, you could instead try split the screen session (ctrl+a, ctrl+S), resise the extra visible window very small (ctrl+a, :resize 2) and have in that which auto-updates like watch -n 10 date for instance.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.