Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!amdcad!ames!ucbcad!ucbvax!cbosgd!osu-cis!tut!lvc From: lvc@tut.cis.ohio-state.edu (Lawrence V. Cipriani) Newsgroups: comp.unix.questions Subject: Re: Want login shell to timeout after 15 mins. Message-ID: <3723@tut.cis.ohio-state.edu> Date: 3 Jan 88 23:46:43 GMT References: <3341@umn-cs.cs.umn.edu> <176@conexch.UUCP> Organization: Ohio State Computer & Info Science Lines: 26 Keywords: Sys-V, idle, logout Summary: TMOUT works only at PS1 previous quotation deleted > > There are several ways to do this. The simplest is to get a copy of the > Korn Shell which supports an environment variable, TMOUT, which if set to > a value greater than zero, will terminate the shell if a command > is not entered within the prescribed number of seconds. You > could set the value of this variable in /etc/profile and then set > it to read-only status to prevent users from changing it. The TMOUT variable only works at PS1. If ksh waits at any other read it will wait forever. For example just type a \ at PS1, ksh prints PS2 and will wait forever. Setting it to read only isn't much help either since a user can type the command: ksh and set TMOUT for that subshell to whatever value he or she desires. Also you can just type in a command like cat or dc without any arguments and sit all day. This is why you have to resort to programs to kill off users. > Here is a copy of a shell program that was published in Unix > World magazine recently. It will log out idle users: Thanks for the program! -- Larry Cipriani AT&T Network Systems at cbosgd!osu-cis!tut!lvc Ohio State University