# Users



## GuillotinePartition (Sep 7, 2012)

Might be a really stupid question, but I would like to know if there is a way to view all of the users embedded in the BSD partition. I created a user but cannot login. It is stated that that user does not exist, but when I try to create a new user under that name it is stated that it is already in use. When I try to delete that user, it is stated that that user does not exist. What should I do? Thanks in advance.x(


----------



## SirDice (Sep 7, 2012)

`# getent passwd`
This basically shows you /etc/passwd.

How did you add the user? I'm guessing you tried to edit /etc/passwd directly? Never, ever, do that!

Use adduser(8) or pw(8) to add a new user.


----------



## mamalos (Sep 7, 2012)

To complement SirDice's post, you can use vipw(8) to see which users are present in your system and edit stuff from there. This is the only proper way of "editing" the /etc/passwd and /etc/master.passwd files.

All the above are true once your system uses local users. In case your users exist in LDAP or any other data source (NIS, etc), then your /etc/nsswitch.conf has to be configured accordingly, and getent(8) will do the work for you, as already SirDice has pointed out.


----------



## GuillotinePartition (Sep 7, 2012)

Definitely helped alot. I found the odd user and edited the account. Thanks for the info guys


----------

