Re: useradd problem(!)
* Sven Burgener (svenb@bluewin.ch) wrote:
>Hello
>
>When I first installed Debian GNU/Linux on this machine, I reconfigured
>it so that there is a "central" user-group called "users" which all
>users of this system belong to.
>
>I have now reconfigured it back to the default:
>
>/etc/adduser.conf
>[...]
>USERGROUPS=yes
>[...]
>
>
>When running useradd, though, I get the following:
>
># useradd -m test
># ls -l /home
>[...]
>drwxr-sr-x 18 svn users 1024 Jan 4 23:28 svn
>drwxr-xr-x 2 test users 1024 Jan 4 23:30 test
>
>There. The new user 'test' still belongs to 'users' and doesn't get a
>new group called 'test'.
Firstwhat version of adduser?? because in my version of adduser(3.11.1)
idon't have that -m flag, now looking at the code, i didn't find it and
in the man page i didn't find it either. About the user bit, the thing
is if you have USERGROUPS=yes, and you have USER_GID=100 adduser it
apparently is defaulting to use this value, i don't know why but it
doesn't make sense the code is very sane, and in my interpretation of it
this shouldn't happen maybe a bug don't know yet *shrug*, try using the
--gid flag and see if it's fixed.
>
>I was curious, so I ran strace over adduser:
>
>[first deleted 'test' again]
>
># strace useradd -m test
>[...]
>open("/etc/default/useradd", O_RDONLY) = -1 ENOENT (No such file or directory)
>[...]
>access("/home/test", F_OK) = -1 ENOENT (No such file or directory)
>mkdir("/home/test", 0) = 0
>[...]
>chown("/home/test", 1001, 100) = 0 <-- why GID 100?
>[...]
See above.
>
>(sorry for the long lines)
>
>First, why is useradd looking for a file at /etc/default/useradd? Is
>this an old location or what? I have only the following there:
I don't know if it's an old location, but it seems it checks to see if
that file exist for some reason *shrug*. I don't see no reference to
this in the code i have.
>
>total 8
>-rw-r--r-- 1 root root 92 Aug 18 23:32 devpts
>-rwxr--r-- 1 root root 641 Aug 18 23:33 rcS
>
>Second, and this is my main problem, why is the GID 100? I have
>explicitly configured "USERGROUPS=yes" in /etc/adduser.conf!
>
>I run an up-to-date woody/testing here.
I run up to date woody too, and i don't have this problem if i do
useradd test
i get the whole bunch of questions and the output of /home/test is:
drwxr-xr-x 2 test test 1024 Jan 6 13:30 test
HTH,
Juan Fuentes
Reply to: