3

I have several GNU/Linux installations that share home and data directories. Over time some user files in these directories have received the group ID 100 (users group under some variants of Linux), others have the group ID 1000 (also the users group, under other variants).

Now I wish to unify the users group ID between all my distributions, but which one should I choose?

I remember there is a Linux standard, does that give a recommended GID for users? If not, is there any other recommendation or trend (I am not asking about personal preferences)?

2

LSB specifies some group names, but users is not one of them.

http://refspecs.linux-foundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/usernames.html

On a completely new setup, you might prefer to avoid using 1000. The way useradd works, it would allocate each user a group, and the numeric identifiers for user and group id will conveniently end up the same. I would call that the preferred approach for modern multi-user systems (I think older systems defaulted to a shared group like users as the primary group of the user instead).

My users are not necessarily a member of a shared group like this on either Fedora or Debian. In this case it would be somewhat academic what number is assigned - it would just be another system group which varies between different distributions. (And another group like bin with no apparent purpose in modern times).

LSB says that UIDs and GIDs 0-99 are statically allocated by the system. UIDs 100-499 (and on all modern systems 100-999) are supposed to be allocated dynamically. This is confirmed by the Debian Policy Manual; it just doesn't have the virtue of being strictly true at the current time.

I'm not really sure what it means that I see users as 100 on a Debian system. It might not be a safe assumption to make, in case the order the groups are allocated in changes for some reason.

On Fedora, it's pretty safe to assume you can allocate id 100, because the automatic allocation of id's 100-1000 actually counts down. (To be clear, this is the opposite of Debian).

Possible options considering your information so far:

  • Stop using the group users. But probably you have some shared files and you'll need to allocate a shared group ID anyway.
  • Use 100 and hope it doesn't break if you [re]install a system that allocates system IDs counting up from 100 like Debian.
  • Use something high enough like 10000, which would never end up allocated automatically.
  • Use 1000 if none of your existing systems use it for something else and you never plan on adding a new OS which accesses your filesystems.[*]
  • Allocate a free ID towards the start of the range 500-1000. (Fedora over five years ago, counted down from 499-100 instead of 999-100, so I can't exclude that you have allocations like that).

[*] Once a system is installed, you can add users with any IDs you want. But my worry is that the initial user created by an OS installer is likely to have ID & GID 1000, not allow you to change them, and particularly if it doesn't create a root user then changing its ID later can be quite annoying).

The 10000 option sounds simplest to me. It would work nicely if you were ever creating a new system, or instructing someone else. It should also work on your current system.

  • 1
    Debian user IDs are static up to 100, including users=100. – Gilles 'SO- stop being evil' Oct 29 '16 at 21:59
  • that's hilarious. makes more sense. citation added – sourcejedi Oct 29 '16 at 22:12
  • 1
    I've been using Debian for almost two decades and users has always been 100. I think that's a bug in the policy manual, the ranges should be 0–100 and 101–999. – Gilles 'SO- stop being evil' Oct 29 '16 at 22:14
  • 1
    Many thanks to you all! I will change over users to GID 100 on all systems and do not expect a lot of trouble (I will be careful when adding new groups and will not install many more programs with their own groups). – Ned64 Oct 29 '16 at 22:19
  • @Gilles, as a suspicious person I think people weren't too eager to write up this quirk, because I think it's inconsistent between UIDs and GIDs, and technically doesn't match the LSB. And in practice I don't see what difference it makes, so I do not complain about this :-). – sourcejedi Oct 29 '16 at 22:25

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.