PDA

View Full Version : adding user account using pw


sneb
August 11th, 2009, 07:45
Hi,
I'm a newbie with FreeBSD. I add a new user account using pw. I decided to remove the account by using "pw userdel -n <name> -u <uid> -r" because I made a mistake with the name. When I add the user again with the same username, it says "pw: login name `fcf' already exists". And when I try to delete it again, it says "pw: user 'fcf' does not exist: No such file or directory".

Can you please help me this. Thanks

SirDice
August 11th, 2009, 08:36
Have a look at the /etc/passwd file. You can use vipw to safely edit it.

sneb
August 11th, 2009, 10:14
Thank you for the reply,
I already check /etc/passwd and the account is not there. I forgot to mention that we have an NIS server. I already checked /etc/master.passwd, /etc/passwd, /var/yp/master.passwd and /var/yp/passwd. I cannot find "fcf" account anymore but still I'm having problem with this.

Alt
August 11th, 2009, 10:21
Dont know what is this.. But i think you must try to run `pwd_mkdb` and then delete..

SirDice
August 11th, 2009, 12:32
Pw only works on the local user database:

Note that pw only operates on the local user and group files. NIS users and groups must be maintained on the NIS server.

From pw.

DutchDaemon
August 11th, 2009, 12:47
Or look into the man files of any of these utilities:

yp_mkdb ypcat ypchpass ypinit yppasswd yppush ypset
ypbind ypchfn ypchsh ypmatch yppoll ypserv ypwhich