adduser Command Error

I'm trying to add a user using the adduser command, but I encountered the following error:
Code:
Username: fwbak
Full name: fwbak
Uid (Leave empty for default):
Login group [fwbak]:
Login group is fwbak. Invite fwbak into other groups? []:
Login class [default]:
Shell (sh csh tcsh nologin) [sh]: nologin
Home directory [/home/fwbak]: /nonexistent
Home directory permissions (Leave empty for default):
Use password-based authentication? [yes]:
Use an empty password? (yes/no) [no]:
Use a random password? (yes/no) [no]:
Enter password:
Enter password again:
Lock out the account after creation? [no]:
Username    : fwbak
Password    : *****
Full Name   : fwbak
Uid         : 2019
Class       :
Groups      : fwbak
Home        : /nonexistent
Home Mode   :
Shell       : /usr/sbin/nologin
Locked      : no
OK? (yes/no) [yes]: y
pw: gid `2033' has already been allocated
adduser: ERROR: There was an error adding user (fwbak).
Add another user? (yes/no) [no]: n
Goodbye!
Has anyone experienced this issue before? If so, could you please share how you resolved it?
Thanks in advance for your help!
 
Code:
pw: gid `2033' has already been allocated
Perhaps this specific group ID has been claimed by someone/something else. What does grep 2033 /etc/group return?

Meanwhile, you could try setting for the user the next available user/group ID, 2034 maybe (or any other following number), in the adduser(8) Uid field (see manual for details), i.e.:
Code:
Uid (Leave empty for default): 2034
 
First: if you want the group to be of the same name then you don't need to specify a name; this is default behavior.

Anyway, /usr/sbin/adduser is actually a shell script that relies on pw to do everything. OP: what does the command pw usernext tell you?

I think you may be onto something here, because when I check the script itself I can find a routine to check for the next available user id (get_nextuid()) but from what I can tell it totally ignores gid's. This makes sense btw, because it simply tells pw to add the group with its name.

So it seems something odd is going on, I'm trying to reproduce as we speak (well.. type, lol ;)).
 
I have found this is caused by the changed of /etc/nsswitch.conf file.
Current I changed group/passwd to files winbind, but the default is compat.
So anyway to work around this?
 
I have found this is caused by the changed of /etc/nsswitch.conf file.
Current I changed group/passwd to files winbind, but the default is compat.
So anyway to work around this?
I noticed that pw useradd (etc) does not play nice when winbind is used in /etc/nsswitch.conf. In cases where I need to manipulate local users, I su -, comment winbind out in /etc/nsswitch.conf, do my thing, and then restore the original /etc/nsswitch.conf. Else pw conks out before winbind has enumerated all 100K users in our uni's AD...
 
So anyway to work around this?
There are many. Here is what I would do: If you have winbind in your nsswitch, it probably means your FreeBSD is co-existing with a Windows AD server. Find out what UID and GID numbers that server uses. Then decide what UID and GID you want to use on your local system. Then edit /etc/passwd (using the vipw command) and /etc/group (using an editor of your choice) and add the user there.
 
Back
Top