Linux의 사용자 그룹(100 또는 1000)에 권장되는 GID는 무엇입니까?

Linux의 사용자 그룹(100 또는 1000)에 권장되는 GID는 무엇입니까?

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)?

답변1

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.
  • 자동으로 할당되지 않는 10000과 같이 충분히 높은 값을 사용하십시오.
  • 기존 시스템 중 어느 것도 다른 용도로 사용하지 않고 파일 시스템에 액세스하는 새 OS를 추가할 계획이 없다면 1000을 사용하세요.[*]
  • 500-1000 범위의 시작 부분에 무료 ID를 할당하십시오. (5년 전 ​​Fedora는 999-100 대신 499-100에서 카운트다운했기 때문에 그러한 할당이 있다는 것을 배제할 수 없습니다).

[*] 시스템이 설치되면 원하는 ID를 가진 사용자를 추가할 수 있습니다. 하지만 걱정되는 점은 OS 설치 프로그램에서 생성한 초기 사용자가 ID 및 GID 1000을 갖고 이를 변경할 수 없다는 것입니다. 특히 사용자를 생성하지 않은 경우 root나중에 ID를 변경하는 것이 상당히 짜증날 수 있습니다.

10000 옵션이 나에게는 가장 간단하게 들립니다. 새로운 시스템을 만들거나 다른 사람에게 지시하는 경우에는 잘 작동할 것입니다. 현재 시스템에서도 작동해야 합니다.

관련 정보