From owner-freebsd-questions@FreeBSD.ORG Tue Apr 8 16:55:06 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE8A7106567C for ; Tue, 8 Apr 2008 16:55:06 +0000 (UTC) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: from gizmo.acns.msu.edu (gizmo.acns.msu.edu [35.8.1.43]) by mx1.freebsd.org (Postfix) with ESMTP id 687268FC2F for ; Tue, 8 Apr 2008 16:55:06 +0000 (UTC) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: from gizmo.acns.msu.edu (localhost [127.0.0.1]) by gizmo.acns.msu.edu (8.13.6/8.13.6) with ESMTP id m38Grvka086975; Tue, 8 Apr 2008 12:53:57 -0400 (EDT) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: (from jerrymc@localhost) by gizmo.acns.msu.edu (8.13.6/8.13.6/Submit) id m38GrvB5086974; Tue, 8 Apr 2008 12:53:57 -0400 (EDT) (envelope-from jerrymc) Date: Tue, 8 Apr 2008 12:53:56 -0400 From: Jerry McAllister To: Ruel Luchavez Message-ID: <20080408165356.GG86589@gizmo.acns.msu.edu> References: <20080408164923.GF86589@gizmo.acns.msu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080408164923.GF86589@gizmo.acns.msu.edu> User-Agent: Mutt/1.4.2.2i Cc: freebsd-questions@freebsd.org Subject: Re: Delete the Users X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2008 16:55:06 -0000 On Tue, Apr 08, 2008 at 12:49:23PM -0400, Jerry McAllister wrote: Just a followup; It looks like rmuser(8) (/usr/sbin/rmuser) is the canonical way to remove a user from the system. You can still use vipw to check out the passwd file. ////jerry > On Tue, Apr 08, 2008 at 01:46:50PM +0800, Ruel Luchavez wrote: > > > Hi.. > > I could log-in as a root in the data server of my friend, he give me a task > > to delete some > > users that he added in the server few months ago. > > Unfortunately, I've tried reading in other blogs but none of them is > > correct, there are some > > but at the end its not what i want. > > I know how to add users using command "adduser' but i cant trace after I add > > user where should > > be its directory?where could i find the list of users in the server? what > > would be the command to delete > > the user? > > If you have root, then run vipw(8). > Look at the entry of the user you want to delete. It will list the > home directory for that user. > > Presuming you want to remove everything about that user: > - First delete everything in the home directory. > - The user's mail inbox is likely to be in /var/mail/USERID. > - There may be a crontab file. > Check that with crontab -u USERID -l If there is nothing there > don't worry about it. > > - and then use find(1) to find all the remaining files and directories > owned by that id. rm them if you want to. If any of them are files > that other account also use, you may have to think out deleting them. > > Once you have removed all the files you want to, then go back > to vipw and delete the entry from the password file. vipw will > manage both the /etc/passwd and /etc/master.passwd as well as > the system password database correctly for you. > Don't try to edit /etc/passwd or /etc/master.passwd directly. > > Of course, you can easily write a script in your choice of favorite > language (sh, csh, Perl, etc) to do all this and all you have to do > is enter in the user id. Probably there are some out there already, > maybe even something in the base system. But, I delete ids so rarely > that I have always done it by hand and not bothered to look. > > ////jerry > > > > > I really need your HELP..Thanks! > > _______________________________________________ > > freebsd-questions@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"