*BSD News Article 70707


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!vic.news.telstra.net!act.news.telstra.net!psgrain!usenet.eel.ufl.edu!hookup!news.mathworks.com!nntp.primenet.com!news.sprintlink.net!news-stk-3.sprintlink.net!news.sprintlink.net!news-stk-11.sprintlink.net!mercury.galstar.com!not-for-mail
From: jmccorm@galstar.com (Josh McCormick)
Newsgroups: comp.unix.bsd.bsdi.misc
Subject: Re: BSDI User Accounts
Date: 11 Jun 1996 23:20:59 GMT
Organization: Galaxy Star - Northeastern Oklahoma Internet
Lines: 34
Message-ID: <4pkv0r$civ@mercury.galstar.com>
References: <31B3180D.4243@bekkers.com.au>
NNTP-Posting-Host: galaxy.galstar.com
X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]

Jamie Bekkers (jamie@bekkers.com.au) wrote:
: 
: 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?

Here is a simple C program called "acct_disabled" to compile:

main() {
  char *a;
  printf ("\n\nYour account has been disabled due to system abuse.\n");
  printf ("\nPress [ENTER] to disconnect.\n\n");
  read(0,a,1);
  exit(0);
}

Once it is compiled and placed in an appropriate place in your filesystem,
you simply set their login shell to be this program. They will be denied
the ability to login or FTP to their account. Do _NOT_ add this program to
"/etc/shells". 

One change you may want to make to the program is to replace the read 
statement with a sleep command for fifteen seconds or so.

-- 

=====================================================================
== Josh McCormick             Galaxy Star Systems                  ==
== jmccorm@galstar.com        Providing Quality Internet Access    ==
== Systems Administrator      WWW: http://www.galstar.com/~jmccorm ==
=====================================================================