You are not logged in.

#1 2012-09-04 18:28:06

BrKrusty
Member
Registered: 2012-09-04
Posts: 4

adduser problem

I have just installed Arch Linux on my VPS. I am getting an unexpected result when I try to add a new user via adduser.

In reading through the Wiki, it says that "defines the group name or number of the user's initial login group; the group name must exist; if a group number is provided, it must refer to an already existing group; if not specified, the behavior of useradd will depend on the USERGROUPS_ENAB variable contained in /etc/login.defs" That is as I expected based on my experience with Debian.

However, when I tried to add a user via adduser, and didn't provide any input when prompted for initial group, the user was added to the Group 'users.' The group 'users' was the default specified inside the square brackets. So I checked /etc/login.defs. It clearly has USERGROUPS_ENAB set to yes, and according to man login.defs, "If set to yes . . . useradd will create by default a group with the name of the user."

I checked /etc/default/useradd, and GROUP is set to 100, the gid of the group 'users.'

Can I surmise that since there is a gid set in /etc/default/useradd, this is causing the behavior I'm seeing? If so, if I change GROUP to no value in /etc/default/useradd, will adduser then follow the USERGROUPS_ENAB setting in /etc/login.defs and create a group with the same name as the username?

TIA

Doug

Offline

#2 2012-09-05 09:01:27

BrKrusty
Member
Registered: 2012-09-04
Posts: 4

Re: adduser problem

I've confirmed that the usual default behavior in Linux is to create a group with the same name as the username. So why isn't that happening in my installation of Arch Linux?

Offline

#3 2012-09-05 09:25:59

jjacky
Member
Registered: 2011-11-09
Posts: 347
Website

Re: adduser problem

Based on what you're describing ("default specified inside the square brackets") sounds to me like you're not using useradd but adduser. The former will work as described in its man page, using whatever you specified in command line. So `useradd bob` should indeed create a group bob.

OTOH adduser is an interactive shell script that will ask you for the group, using "users" as default (shown inside brackets indeed) and requiring an already existing group.

Offline

#4 2012-09-05 09:27:51

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,682

Re: adduser problem

I believe the "usual default behavior" depends on the distribution.  Just consider changing the value of umask if you decide to create distinct groups per user.

Last edited by skunktrader (2012-09-05 09:35:59)

Offline

#5 2012-09-05 19:31:42

BrKrusty
Member
Registered: 2012-09-04
Posts: 4

Re: adduser problem

Thanks for the reply, jjacky.

Yes, as the topic name and my text states, I am using adduser. I know it is a shell script, and on the Debian systems I've worked on, adduser creates a group with the same name as the username, just like useradd does.

I assumed that adduser populated its defaults from the login.defs file, but that seems not to be the case. For when I change the value of GROUP in login.defs, adduser continues to put the user in the group 'users' unless a different group is specified and already created.

Still, your reply has sent me considering in the right direction. Thanks.

Doug

Offline

Board footer

Powered by FluxBB