remove users from system

John Oxley oxo at rucus.ru.ac.za
Thu May 13 13:54:08 PDT 2004


On Thu 2004-05-13 (11:31), Kent Stewart wrote:
> On Thursday 13 May 2004 11:14 am, OLAF STEIN wrote:
> > hi everybody,
> >
> > i recently switched from linux to freebsd, so this question might
> > sound a little stupid
> >
> > the problem
> > i removed 2 users from my system by deleting their entries in
> > /etc/passwd and /etc/group (they had their own group and where in no
> > other groups)
> >
> > the users are still able to login after i deleted them
> > the rmuser command now does not remove them anymore because it cannot
> > find their entries in /etc/passwd, cause as mentioned i deleted them
> > from their
> >
> > the handbook lists all actions that are taken, when the rmuser
> > command is executed and i did all actions manually except the
> > deletion of the home directories of those users, because i want to
> > keep them
> >
> > how can i remove those users completely?
> > and is there something like a /etc/shadow file?
> >
> 
> Use vipw to do the delete. You deleted the text in the shadow text file 
> and left /etc/master.passwd with the previous working version. You can 
> force the update of master.passwd but I think you should get used to 
> using vipw.

/etc/passwd is a world readable version on /etc/master.passwd so that no one
can see your password hash.  editing /etc/passwd is pointless, and editing
/etc/master.passwd to delete a user is like using a cannon to kill a mosquito.
Use pw userdel -rn username to delete the user from /etc/master.passwd, rebuild
the pwd.db, remove him/her from all the groups and kill their homedir.

Editing master.passwd is a *VERY* bad idea unless you use vipw, which rebuilds
pwd.db so in short, DON'T.  Read the man pages for pw, as it is very useful for
manipulating users and groups.

Hope this helps.

-Ox

-- 
/~\ The ASCII           ASCII stupid question, get a EBCDIC ANSI.
\ / Ribbon Campaign     John Oxley
 X  Against HTML        http://oxo.rucus.net/
/ \ Email!              oxo <at> rucus.ru.ac.za
"Personally, I'd rather pay for my freedom than live in a bitmapped, pop-up-happy dungeon like NT."
		-- Thomas Scoville


More information about the freebsd-questions mailing list