1

Here is an extract of /etc/default/useradd:

GROUP=1005

Here is an extract of /etc/login.defs:

USERGROUPS_ENAB no

Here is the useradd command I run to create a user:

$ sudo useradd test22


$ id -a
uid=1006(test22) gid=100(users) groups=100(users)

According to man page of useradd above should give me gid=1005. But it give me the default gid=100.

Why doesn't it give me gid=1005?

Here are additional information:

$ sudo useradd -D
GROUP=1005
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel
CREATE_MAIL_SPOOL=no


$ sudo apt-cache policy passwd
passwd:
  Installed: 1:4.4-4.1
  Candidate: 1:4.4-4.1
  Version table:
 *** 1:4.4-4.1 500
        500 http://debian.lth.se/debian stretch/main amd64 Packages
        100 /var/lib/dpkg/status
  • Does a group with GID 1005 exist? – Thomas Feb 17 '18 at 18:25
  • Is GROUP reset to 100 later in your /etc/default/useradd? – Kusalananda Feb 17 '18 at 18:26
  • Yes, GID 1005 exists in /etc/group – Nameen Feb 17 '18 at 18:28
  • There is only one entry of GROUP in /etc/default/useradd. That is GROUP=1005 Therefore I cannot see how it can be reset later on. – Nameen Feb 17 '18 at 18:30
  • Does the same thing happen if you use the -N flag with useradd? – Kusalananda Feb 17 '18 at 18:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.