Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!mcvax!inria!axis!philip From: philip@axis.fr (Philip Peake) Newsgroups: comp.unix.questions Subject: Re: Disabling logins under System V Message-ID: <256@axis.fr> Date: Wed, 15-Jul-87 05:44:43 EDT Article-I.D.: axis.256 Posted: Wed Jul 15 05:44:43 1987 Date-Received: Fri, 17-Jul-87 06:36:53 EDT References: <905@woton.UUCP> Organization: Axis Digital, Paris Lines: 40 Summary: easy ! In article <905@woton.UUCP>, riddle@woton.UUCP (Prentiss Riddle ) writes: > I am looking for some advice about the preferred way to temporarily > disable all user logins under System V. What I want is something > analogous to the BSD "/etc/nologin" file (or is that what it's really > called? I can't remember): I want to run in multi-user mode but allow > only root to log in. Furthermore, I want a simple, reversible solution > that can be run by the person who comes in on weekends to do our > backups. The easiest way that I can think of is to use /etc/profile. Its much less dangerous than playing with /etc/passwd or /etc/inittab. Just include the following in your /etc/profile: if [ -f /etc/nologin ] then . /etc/nologin fi Inside the file /etc/nologin you put whatever you want, such as: case $LOGNAME in root) ;; *) echo "Sorry, logins are disabled" exit ;; esac The only real disadvantage to this scheme is that they will have actually logged in before being thrown off again. But is the reason for doing this is simply to allow uninterupted backups, then it will do. You could also put a little message into /etc/issue to tell them that it is not worth the effort of trying to login. Philip