You are not logged in.
Pages: 1
I needed an user for mldonkey and I issued the following command:
sudo useradd -b /shared -m -U -s /bin/false -r p2p
in order to create the p2p system account (-r) with the same named group (-U), the /shared/p2p home directory (-m -b /shared) and no login shell (-s /bin/false).
Something has gone wrong because the p2p group has been created with the same gid of the nobody group:
$ grep 'nobody\|p2p' /etc/group
nobody:x:99:
p2p:x:99:
the p2p user belongs to the nobody group:
$ groups p2p
nobody
and I can't delete the p2p group or even modify its gid:
$ sudo groupdel p2p
groupdel: cannot remove the primary group of user 'nobody'
$ sudo groupmod -g 124 p2p
groupmod: Cannot determine your user name.
(the groupmod error message doesn't make any sense to me)
Any ideas?
One of these days I'm gonna learn to play and write myself a song
Offline
This isn't best practice but what if you manually change the group id of 'p2p' in /etc/group and also change the group id for the user 'p2p in /etc/passwd (if you go this route, pick a number in the thousands like 2000 or something)?
This isn't something you want to do all the time but I don't see this being done with any user or group command.
Like I said, this isn't good practice but if you exhausted your options with using the 'usermod' 'userdel', 'groupmod' and 'groupdel', then you don't have to many other options...
Just a thought.
Arch linux i686 | Dell XPS m1530 | Intel Core 2 Duo 2 GHz | 3 GB RAM | 250GB HDD
Offline
Thanks ruffedgz, but just to be sure I restored the /etc/passwd- /etc/group- /etc/shadow- backups.
I tried
groupadd -r p2p
but gid was 99, same as `nobody' again.
So I guess the cause of the problem is groupadd selecting a gid that's already used.
Am I the only one with this issue?
One of these days I'm gonna learn to play and write myself a song
Offline
I think the group must exist before adding user into it. You may try to use groupadd to do that. If it complains try, deleting the p2p group first.
Offline
So I tried your command on post #3 and got the same thing. The reason for that is I never set my SYS_GID_MIN and SYS_GID_MAX in the /etc/login.defs file. Use whatever editing software you like and add this line to the bottom of the file:
SYS_GID_MIN 1 #can't use 0 since that is root
SYS_GID_MAX 99
Save the file. Perform the command:
groupadd -r p2p
and the group will use a number that is between the min and max for system groups. Hope this works for ya.
Arch linux i686 | Dell XPS m1530 | Intel Core 2 Duo 2 GHz | 3 GB RAM | 250GB HDD
Offline
Thanks ruffedgz.
It's a shadow bug:
http://bugs.archlinux.org/index.php?do= … k_id=16092
From the bug tracker's comments it seems that there's no obvious solution.
I prefer not to fiddle with logins.defs, so I think I will use user accounts also for services like mldonkey until this bug is fixed.
One of these days I'm gonna learn to play and write myself a song
Offline
Pages: 1