1832396 Members
3380 Online
110041 Solutions
New Discussion

Timeouts with Telnet

 
SOLVED
Go to solution
Scott Van Kalken
Esteemed Contributor

Timeouts with Telnet

I know this is a stupid question, but does anyone know where you'd set an idle timeout on a telnet session?

thanks in advance.

Scott.
2 REPLIES 2
Steven Sim Kok Leong
Honored Contributor

Re: Timeouts with Telnet

Hi,

Use the environment variable TMOUT. You can set it either in
1) /etc/profile
2) $HOME/.profile (for sh, bash, ksh shells)
3) $HOME/.cshrc or $HOME/.login (for csh, tcsh shells)

For 2), export TMOUT=600 (for 600 seconds or 10 mins)
For 3), setenv TMOUT 600

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
Bill Hassell
Honored Contributor
Solution

Re: Timeouts with Telnet

Actually, the shell timeout in csh is called autologout. Nothing in csh is compatible with anything else. ;-)

Note that this is a shell idle time value. It does not monitor an entire session so a user that starts a copy of vi and goes on vacation will still have vi running days later. If you want to enforce the TMOUT value for everyone and not allow them to change it (including root, which is a good idea), use:

export readonly TMOUT=3600

in /etc/profile (this sets POSIX sh, ksh and similar shells). Make sure you assign a value on the same line. Once you set readonly attribute (ie readonly TMOUT) you can't change the value, even if it is null.


Bill Hassell, sysadmin