Xref: utzoo comp.unix.admin:98 comp.unix.shell:134 Newsgroups: comp.unix.admin,comp.unix.shell Path: utzoo!sq!dmh From: dmh@sq.sq.com (David Harrison) Subject: Re: Logging a User Off Message-ID: <1990Sep12.110852.16410@sq.sq.com> Organization: SoftQuad Inc., Toronto, Canada References: <1990Sep11.173008.274@mccc.uucp> Date: Wed, 12 Sep 90 11:08:52 GMT Lines: 35 In article <1990Sep11.173008.274@mccc.uucp> pjh@mccc.uucp (Pete Holsberg) writes: >However, I would like to be able to terminate the login process .. >BUT, simply executing "exit" [in /etc/profile] doesn't abort the >login; it aborts /etc/profile! What can I execute to terminate >the login of a user ... "kill -9 0" has worked for me in Sys III, SysV.3, and now SunOS. Also: >For reasons that are beyond the scope of this question, all new logins >on one of my systems (3B2.400 SVR3.1) get no initial password. I've >written a little script that I put into /etc/profile. It examines the >password field of /etc/passwd for the user logging in and runs the >passwd program if the password field is empty. Beware: the passwd(1) command tries to keep two users from simultaneously editing the password file by creating a tmp file in /etc: if that file already exists passwd refuses to run for a second user. This can lead to a race condition if two users invoke passwd at almost the same time, and under suitable conditions you can end up with no password file at all! I used to have my 1400 undergraduates choose their own passwords, and ended up surrounding passwd with a wrapper that put up a semaphore to avoid the race; I don't know how we would do it under SunOS. (We abandoned the scheme because too many students forgot what they had chosen; now a much smaller percentage of them lose the paper we give them with the password on it. :-{ ) -- David Harrison, Dept. of Physics, Univ. of Toronto, harrison@faraday.physics.utoronto,ca ..uunet!utgpu!utfyzx!harrison (Just reading the news at SoftQuad; not affiliated with them and they ain't responsible for me at all.)