About Linux User and Group
PAGE TAGS: Linux user account control user groups id
LINUX USER AND GROUP
User accounts control the ability to log on to a system, access resources, and perform certain actions. Groups provide a means of grouping users for administrative purposes such as assigning permissions to files.
When you work with users and groups, you will use a friendly name (such as mary or sales) to refer to the user or group. However, the system uses ID numbers to identify users and groups.
• The user ID (UID) and the group ID (GID) are typically automatically assigned by the system (although in some cases you can modify the ID number if you like).
• The root user has a UID of 0.
• Users you create are assigned UIDs 500 and above.
Users can be members of two different group types:
• Primary group (also called the private group). By default, when you create a user, a corresponding group is also created. The user is the only member of this group. When you create files and directories, the primary group is automatically made the owner of those files.
• Secondary groups. Secondary groups are groups you create. You assign members to those groups, and then use permissions to control access to files.
Note: The primary group is just a group like any other group. The only difference is that the user account specifically identifies the primary group for each user.
The user and group databases are stored in the following files:
/etc/passwd
- Holds user account information including the user name, UID, primary group membership, and the home directory location.
/etc/shadow
- Holds passwords and password expiration information for user accounts. Using a separate file increases the security of the user passwords.
/etc/group
- Holds group information including the group name, GID, and group membership information.
/etc/gshadow
- Holds passwords for groups.