1833788 Members
2770 Online
110063 Solutions
New Discussion

Time Out

 
P.V.Ramesh
Advisor

Time Out

How can i time out any session after certain amount of idle time
6 REPLIES 6
A. Clay Stephenson
Acclaimed Contributor

Re: Time Out

By setting and exporting the TMOUT environment variable to a non-zero number of seconds.
If it ain't broke, I can fix that.
Dietmar Konermann
Honored Contributor

Re: Time Out

Hi!

For Posix or Korn Shell sessions you may use the TMOUT environment variable, e.g. to be set in /etc/profile. See man sh-posix(1).

Regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Jeff Schussele
Honored Contributor

Re: Time Out

Hi P.V.

You'll need to use & set the TMOUT env var for all or individual users
For all set in -> /etc/profile
For individual users -> set in the .profile or equivalent file.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Deshpande Prashant
Honored Contributor

Re: Time Out

HI
For Ksh use following lines in /etc/profile.
##
TMOUT=600
readonly TMOUT
##
This will timeout shells at prompt after 10 minutes of idle time.

Thanks.
Prashant.
Take it as it comes.
Bill Hassell
Honored Contributor

Re: Time Out

And for csh users, the variable is: autologout and is measured in minutes. NOTE: for all shell timeouts, these work only if the user returns back to the shell. The timer starts when the shell prompt is displayed. If a user decides to run vi and then leave for vacation, the shell is waiting on vi and can't run the timer.


Bill Hassell, sysadmin
Wodisch_1
Honored Contributor

Re: Time Out

Hi,

since $TMOUT and such won't work if the user has a "sleep 999" running, how about "idled" (idle daemon)?

Just my $0.02,
Wodisch
PS: there was a question just like yours very recently, so "search"ing for it might bring you additional answers...