Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Jan 1996 22:55:41 -0700
From:      kelly@fsl.noaa.gov (Sean Kelly)
To:        JSINNOTT@pomona.edu
Cc:        chat@freebsd.org
Subject:   Re: BASH shell script question..
Message-ID:  <9601060555.AA08315@emu.fsl.noaa.gov>
In-Reply-To: <01HZNTWGSU6Q8WX29B@POMONA.EDU> (message from JOHN on Fri, 05 Jan 1996 18:56:10 -0800 (PST))

next in thread | previous in thread | raw e-mail | index | archive | help
>>>>> "JOHN" == JOHN  <JSINNOTT@pomona.edu> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9601060555.AA08315>