Operating System - Linux
1826564 Members
3470 Online
109695 Solutions
New Discussion

Re: Timeout inactive telnet session

 
yyghp
Super Advisor

Timeout inactive telnet session

I found that I could timeout inactive telnet session by setting TMOUT environment variable:

# export TMOUT=10

then if I stay in shell, I will be kicked out after 10 seconds:

# timed out waiting for input: auto-logout
Connection to host lost.

But if I run some applications after login to the shell, the Timeout didn't work. For example, I did a test to run "top" after setting TMOUT=10, but the telnet seesion didn't timeout until I quited "top" back to the shell, and counted another 10 seconds...

Now I need to kick out inactive users who run an Oracle application after they login to the shell, force them logout after they finish their shift.

Thanks!
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: Timeout inactive telnet session

TMOUT was never designed to work once an application was invoked.

Its up to the application developer/administrator to configure the application to time out the user. Then TMOUT will work.

This behavior is by design. Imagine what would happen if TMOUT killed a session while it was say updating some oracle data without keyboard input.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
RAC_1
Honored Contributor

Re: Timeout inactive telnet session

The system is acting the way it is supposed to be. If you just start something and live it that way, the shell will not timeout.

You may need to look at idle time (from who -uH) and explicitly kill such sessions. You need to be very careful when doing this. Educating the users will also help you a lot.

Anil
There is no substitute to HARDWORK
yyghp
Super Advisor

Re: Timeout inactive telnet session

Thanks Steven and RAC !
Yes, it's reasonable that the TMOUT is acting like this.
But I noticed some users didn't logout their sessions on their devices after their shift, by checking the idle time ( who -u ), is there any better solution for this besides educating them ?
Stuart Browne
Honored Contributor

Re: Timeout inactive telnet session

There used to be a daemon called 'idled', of which would log-out terminals idle for a given period of time. But this package is no longer maintained.

There is also one called 'timeoutd', but i've never used it and can't access the source tree any more.

What appears to be more recent is the 'autolog' program. I can't find any RH packages, but you should be able to grab the SuSE src.rpm and rebuild it for your platform.

ftp://ftp.suse.com/pub/suse/i386/9.3/suse/src/autolog-0.35-722.src.rpm

for example.
One long-haired git at your service...