Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jan 1996 06:31:54 GMT
From:      gestur@islandia.is (Gestur A. Grjetarsson)
To:        Joe Beiter <jwb@xioa.cosmic.org>
Cc:        freebsd-isp@FreeBSD.org
Subject:   Re: deluser
Message-ID:  <199601160631.GAA11793@hummer.islandia.is>

next in thread | raw e-mail | index | archive | help
>
>
>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

   -----------------------------------------------------------




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