This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "Group identifier" – news ·newspapers ·books ·scholar ·JSTOR(September 2014) (Learn how and when to remove this message) |
InUnix-like systems, multiple users can be put intogroups.POSIX and conventionalUnixfile system permissions are organized into three classes,user,group, andothers. The use of groups allows additional abilities to be delegated in an organized fashion, such as access to disks,printers, and otherperipherals. This method, among others, also enables thesuperuser to delegate some administrative tasks to normal users, similar to theAdministrators group onMicrosoft Windows NT and its derivatives.
Agroup identifier, often abbreviated toGID, is a numeric value used to represent a specific group.[1] The range of values for a GID varies amongst different systems; at the very least, a GID can be between 0 and 32,767, with one restriction: the login group for the superuser must have GID 0. This numeric value is used to refer to groups in the/etc/passwd and/etc/group files or their equivalents.Shadow password files andNetwork Information Service also refer to numeric GIDs. The group identifier is a necessary component ofUnixfile systems andprocesses.
In Unix systems, every user must be a member of at least one group, theprimary group, which is identified by the numeric GID of the user's entry in the passwd database, which can be viewed with the commandgetent passwd (usually stored in/etc/passwd orLDAP). This group is referred to as theprimary group ID. A user may be listed as member of additional groups in the relevant entries in the group database, which can be viewed withgetent group (usually stored in/etc/group orLDAP); the IDs of these groups are referred to assupplementary group IDs.
Unix processes have aneffective (EUID, EGID), areal (UID, GID) and asaved (SUID, SGID) ID. Normally these are identical, but insetuid andsetgid processes they are different.
Originally, a signed 16-bit integer was used. Since the sign was not necessary – negative numbers do not make valid group IDs – an unsigned integer is now used instead, allowing group IDs between 0 and 65,535. Modern operating systems usually use unsigned 32-bit integers, which allow for group IDs between 0 and 4,294,967,295.
Many Linux systems reserve the GID number range 0 to 99 for statically allocated groups, and either 100−499 or 100−999 for groups dynamically allocated by the system in post-installation scripts. These ranges are often specified in/etc/login.defs, foruseradd,groupadd and similar tools.
On FreeBSD, porters who need a GID for their package can pick a free one from the range 50 to 999 and then register this static allocation inports/GIDs.[2]
(gid_t) -1 is reserved by POSIX to identify an omitted argument.[3]Many system administrators allocate for each user also a personal primary group that has the same name as the user's login name, and often also has the same numeric GID as the user's UID. Such personal groups have no other members and make collaboration with other users in shared directories easier, by allowing users to habitually work withumask 0002. This way, newly created files can have by default write permissions enabled for group members, because this will normally only enable write access for members of the personal group, that is only for the file's owner. However, if a file is created in a shared directory that belongs to another group and has thesetgid bit set, then the created file will automatically become writable to members of that directory's group as well.
On many Linux systems, theUSERGROUPS_ENAB variable in/etc/login.defs controls whether commands likeuseradd oruserdel automatically add or delete an associated personal group.
== References ==https://t.me/+-i_KpUzElE8zNDhl