From owner-freebsd-chat Fri Jan 5 21:55:45 1996 Return-Path: owner-chat Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id VAA26783 for chat-outgoing; Fri, 5 Jan 1996 21:55:45 -0800 (PST) Received: from fslg8.fsl.noaa.gov (fslg8.fsl.noaa.gov [137.75.131.171]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id VAA26778 for ; Fri, 5 Jan 1996 21:55:42 -0800 (PST) Received: by fslg8.fsl.noaa.gov (5.57/Ultrix3.0-C) id AA13730; Fri, 5 Jan 96 23:55:42 -0600 Received: by emu.fsl.noaa.gov (1.38.193.4/SMI-4.1 (1.38.193.4)) id AA08315; Fri, 5 Jan 1996 22:55:41 -0700 Date: Fri, 5 Jan 1996 22:55:41 -0700 From: kelly@fsl.noaa.gov (Sean Kelly) Message-Id: <9601060555.AA08315@emu.fsl.noaa.gov> To: JSINNOTT@pomona.edu Cc: chat@freebsd.org In-Reply-To: <01HZNTWGSU6Q8WX29B@POMONA.EDU> (message from JOHN on Fri, 05 Jan 1996 18:56:10 -0800 (PST)) Subject: Re: BASH shell script question.. Sender: owner-chat@freebsd.org Precedence: bulk >>>>> "JOHN" == JOHN writes: JOHN> If I want a command to exit a shell script, and then exit JOHN> the login shell (logging out the user), how would I pass the JOHN> command to the login shell? The script could send kill -HUP to the login shell. JOHN> Or, even better, is it possible to make a shell script the JOHN> login shell, so that once the script exits, the user is JOHN> logged off? Yes. Just make the script the login shell in the password file for the user in question. As root, use vipw or chpass -s to change the login shell to the full pathname of the script. Make sure the script is executable. That's it. Also, if you DON'T list the script pathname as a valid shell in /etc/shells, the user won't be able to change his login shell to anything else. If you do list the script pathane in /etc/shells, then the user can change his login shell to anything else listed in /etc/shells. -- Sean Kelly NOAA Forecast Systems Laboratory, Boulder Colorado USA I saw a bank that said "24 Hour Banking", but I don't have that much time. -- Steven Wright