On Thu, Sep 15, 2011 at 11:28 AM, Richard Toohey <[email protected]> wrote: > Hi, guys. > > I wanted to disable a user account under OpenBSD 4.9, and Google led me here: > > http://www.openbsd.org/faq/faq10.html#AddDelUser > > <quote>Removing users > > To remove users with the user(8) hierarchy of commands, you will use > userdel(8). This is a very simple, yet usable command. To remove the user > created in the last example, simply: > > # userdel -r testuser > Notice the -r option, which must be specified if you want the users home > directory to be deleted as well. Alternatively, you can specify -p and not -r > and this will lock the user's account, but not remove any > information.</unquote> > > That last sentence - sounds exactly like what I need - so I try it: > > # userdel -p testuser > usage: userdel -D [-p preserve-value] > B B B userdel [-prv] user > > The man page suggests that it should work as well. > > Looks like it has been raised before: > > http://www.mail-archive.com/[email protected]/msg01370.html > > No patches because I'm not exactly sure what the "right" answer(s) are. > > Am I just doing it wrong?
$ id test uid=1001(test) gid=1001(test) groups=1001(test) $ sudo userdel -pv test $ id test id: test: No such user $ grep test /etc/passwd $ ls -ld /home/test drwxr-xr-x 3 1001 test 512 Sep 15 11:52 /home/test $ $ sudo chsh test chsh: unknown user: test $ $ sudo userdel -pv test userdel: No such user `test' $ I'm on current. Anyway strange that -v switch doesn't provide verbose output in fact and that information in password file was not preserved in fact. User disappeared somewhere, but where :-) Files are in place as you can see. > > Thanks.

