From owner-freebsd-isp Mon Jan 15 22:35:58 1996 Return-Path: owner-isp Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id WAA16556 for isp-outgoing; Mon, 15 Jan 1996 22:35:58 -0800 (PST) Received: from isgate.is (isgate.is [193.4.58.51]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id WAA16534 for ; Mon, 15 Jan 1996 22:35:52 -0800 (PST) Received: from hummer.islandia.is by isgate.is (8.7.3/ISnet/14-10-91); Tue, 16 Jan 1996 06:35:39 GMT Received: from skalmarbaer.islandia.is by hummer.islandia.is (8.6.11/ISnet/12-09-94); Tue, 16 Jan 1996 06:31:54 GMT Date: Tue, 16 Jan 1996 06:31:54 GMT Message-Id: <199601160631.GAA11793@hummer.islandia.is> X-Sender: gestur@islandia.is X-Mailer: Windows Eudora Version 2.0.3 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit To: Joe Beiter From: gestur@islandia.is (Gestur A. Grjetarsson) Subject: Re: deluser Cc: freebsd-isp@FreeBSD.org Sender: owner-isp@FreeBSD.org Precedence: bulk > > >I saw this was brought up a couple of times in the mail list archives but >I couldn't seem to find the program. I need a program that will remove a >specified user from the system (passwd entry, home directory and mailbox). > >I'm presently trying to hack vipw to do it but since I'm not much of a c >programmer this is both difficult and dangerous. If it already exists I'd >be overjoyed to find it :) > >Its the only thing presently keeping me from migrating our systems over from >linux to freebsd. The adding and deleting of accounts is handled by >administrative personnel that would not do well with the passwd file in an >editor. > > Try make new script used for erasing accounts in /usr/bin like thisone: /usr/bin/closeaccount begin script: --------------------- #!/bin/sh rm -r /usr/home/$1 rm /var/mail/$1 rm /var/mail/.$1.pop vipw ---------------------- end script chmod 700 /usr/bin/closeaccount the command would be "closeaccount user", where the script would take user assigned for $1 in the script. where in vipw, you find the user password like and erase it from there. the script should be finished erasing the user from your user dir when you finish the vipw edit. Međ kveđju, Sincerely, ----------------------------------------------------------- Gestur A. Grjetarsson kerfisstjóri islandia.is sysadmin islandia.is Islandia, Grensásvegur 7, 2h.t.h., 108 Reykjavik sími 5884020, modem 5884120, fax 5884014 http://www.islandia.is http://www.islandia.is/english.htm ----------------------------------------------------------- Programmers never die, they just GOSUB without RETURN ! The only thing which makes you eternal, is to live a life worth remembering -----------------------------------------------------------