# adding user account using pw



## sneb (Aug 11, 2009)

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 (Aug 11, 2009)

Have a look at the /etc/passwd file. You can use *vipw* to safely edit it.


----------



## sneb (Aug 11, 2009)

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 (Aug 11, 2009)

Dont know what is this.. But i think you must try to run `pwd_mkdb` and then delete..


----------



## SirDice (Aug 11, 2009)

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(8).


----------



## DutchDaemon (Aug 11, 2009)

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
```


----------

