*BSD News Article 70189


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!news.mel.connect.com.au!news.mira.net.au!inquo!bofh.dot!in-news.erinet.com!imci5!pull-feed.internetmci.com!news.internetMCI.com!newsfeed.internetmci.com!news.emeraldis.com!ppp27.emeraldis.com!user
From: david@emeraldis.com (David G. Cannon)
Newsgroups: comp.unix.bsd.bsdi.misc
Subject: Re: BSDI User Accounts
Date: 5 Jun 1996 01:56:51 GMT
Organization: Emerald Internet Services
Lines: 42
Message-ID: <david-0406962135450001@ppp27.emeraldis.com>
References: <31B3180D.4243@bekkers.com.au>
NNTP-Posting-Host: ppp27.emeraldis.com

In article <31B3180D.4243@bekkers.com.au>, Jamie Bekkers
<jamie@bekkers.com.au> wrote:

> Hi.
> 
> I have scoured our manuals and could not find what I wanted, so I hoped
that some 
> kind person out there could tell me how to do this.
> 
> I want to disable a user account, but not so they can not log in.  But
rather it 
> would give then a message like: "Your account has been disabled due to
system abuse" 
> and then log them off?
> 


BSDI 2.1 (I don't know about earlier versions) provides a way to do this.
Just set their login shell to "/sbin/nologin". This will display a message
and then close the connection. You can edit the "nologin" script to
display whatever you like before disconnecting them. Here's what mine has:


echo ''
echo '+ --------------------------------- +'
echo '| Your account has been put on hold |'
echo '|  If you have any questions call:  |'
echo '|     Emerald Internet Services     |'
echo '|             942-9600              |'
echo '+ --------------------------------- +'
echo ''
exit 1


It works great!


David G. Cannon


P.S. - To disable an account without displaying a message when they try to
login, use "/usr/bin/false"