TTY Timeouts ?

TTY Timeouts ?

Post by roo » Fri, 13 Oct 1995 04:00:00



Can anybody please tell me what is the most elegent way to monitor
user idle time during a login session. The users are attached using dumb
terminals and if they type nothing for, say 1/2 hour, and there is no
new output to their screen, the system will log them out.

Prefrably a solution that will work on all UNIX'es, or specificaly for
OSF1^H^H^H^H Digital Unix.

--
Richelo Killian                  __
                                / /\





Friends don't let friends use DOS

URL: http://165.143.31.191/slug.html
Everyone should know of all information that others have deemed unfit for
public knowledge.               -Author Unknown
Tel : + 27 12 311-4092 (W) + 27 825535878 (Cel)

 
 
 

TTY Timeouts ?

Post by Clark Mil » Tue, 17 Oct 1995 04:00:00


: Can anybody please tell me what is the most elegent way to monitor
: user idle time during a login session. The users are attached using dumb
: terminals and if they type nothing for, say 1/2 hour, and there is no
: new output to their screen, the system will log them out.

Maybe put them in a shell that has autologout features like tcsh?  I don't
use it myself and am unsure what it would do while you are in an application
but it definately logs you out of the command line when idle for X minutes.

--

Voice: 64-21-935002   Disclaimer: All errors are ( )o |$ nice -20 work &|  </'
Web  : <http://www.kiwi.gen.nz>   line niose!    /\  \|$ exec games     | /)
Snail: P O Box 78219, Grey Lynn, Auckland, New Zealand+---- ZL1UYY -----+(/`

 
 
 

TTY Timeouts ?

Post by Joe Wine » Tue, 17 Oct 1995 04:00:00



>Can anybody please tell me what is the most elegent way to monitor
>user idle time during a login session. The users are attached using dumb
>terminals and if they type nothing for, say 1/2 hour, and there is no
>new output to their screen, the system will log them out.

There may be a more elegant solution out there, but here's mine
anyway:  I wrote a program started by cron every 15 minutes which
checks the /dev/tty files for every logged in user.  On our altos
system the file modification time is the time of the last write to the
terminal.

If the terminal has timed out I try SIGTERM then SIGKILL the group.  I
also have to open the tty and send the reset sequences defined in
terminfo database for the terminal.  Seems like the next login process
would reset the terminal, but ours doesn't.

This works for most of our applications.  Sometimes people leave there
terminals sitting in our accounting package (which ironically contains
the most confidential information) -- that package updates the time
for the user menu every minute, so those terminals never time out.

There has got to be a better way of doing it...

Joe Winett

 
 
 

1. Having a TTY timeout



We use a script on our RS6000 that runs from cron every four minutes.  It
does a "w", cuts the idle time value, and checks to see if over 40 minutes.
 If it is, "sendmsg" flashes a "PRESS A KEY OR YOU WILL BE LOGGED OFF"
message on the user's screen.  If the idle time is over 45 minutes, the
fuser program (/etc/fuser, I believe) will log them off the system.  A
"clunkier" way is to ps -fe|grep $user|cut the process numbers and use kill
-kill # #.  Whenever a program like this is used, make sure the user is not
SUID root or operating with root permissions.  

Another way is to have your modems time-out and dump any connection that is
idle for more than a preset time.  Many modems have this feature.  If yours
can't do this, consider a more secure modem (we use USR V.Everything).  We
also use EXTERNAL modems where we can see the indicator lights.

The fact that the phone line didn't drop on your end indicates a problem as
well.  The modems should be set with an at&d2.  On most modems, this hangs
up the phone line (drops DTR) whenever a logout occurs.  

The best way to hadle the problem is to have your HOST modem disconnect and
dial back your PC at a pre-determined number.  There is a danger that the
phone line could disconnect and if still logged on, a hacker could connect
on the same port and continue your session.  

Let me know if u want a copy of the script.

LT Brian Pecora
Asst. Records Officer
Fairfield (CT) Fire-Rescue

2. Corrupted Slackware distribution @ sunsite.unc.edu

3. Need help with pseudo tty, read(), and timeout

4. FS: Netscape SuiteSpot 3.5 server software

5. Linux only recoginizes up to 16MB of memory

6. Samsung 193P with MagicTune under Linux

7. How to map a tty port to another tty port

8. creating tty's, mknod, stuck after boot with wrong tty - help

9. problems with tty, U469036 - bos.rte.tty.4.3.2.9

10. - can one change tty modes for tty not stdio ?

11. tty, tty... where art thou ...?