Lecture # 16 - Users, Groups, their Association and, their Configurations Files in Linux

Lecture # 16 - Users, Groups, their Association and, their Configurations Files in Linux

Users and Groups. Types of Users. User and Group Association. User Configuration Files. Group Configuration Files.

Linux User:

User refers to an individual who utilizes the system's resources. A user account provides security boundaries between different people and programs that can run commands. A user is associated with a unique identification number known as User ID (UID).

Types of Users:

There are two types of users:

  1. System Accounts:

    System accounts are the accounts that are by default made by the system for us.

    -> Administrator

    -> Root

    -> Service Accounts

    -> bind

    -> www-data

    -> apache2

  2. Custom Accounts:

    Custom accounts are the accounts that are made by us.

    -> Normal Accounts

    -> abdullah

    -> hamza

    -> john

User ID (UID) Range:

  1. System Accounts -> (0 - 999)

  2. Custom Accounts -> (1,000 - 60,000)

    0 UID is for the root user. You can see the Minimum and Maximum UID's in /etc/login.defs file.

User Configuration Files:

There are two user configuration files that store information about user and user password. These files are located in the /etc directory. The files are:

  • /etc/passwd:

    The passwd file located in the /etc directory holds the information about the user account.

  • /etc/shadow:

    The shadow file located in the /etc directory saves the passwords of the users in encrypted format along with the days since the password last changed.

Linux Group:

The collection of users who have the privilege to access the same resources is called a group. The users in the same group can access all the resources assigned to that group. Group has also a unique identification number known as Group ID (GID).

Group ID (GID) Range:

  1. System Accounts -> (0 - 999)

  2. Custom Accounts -> (1,000 - 60,000)

    0 UID is for the root group. You can see the Minimum and Maximum GID's in /etc/login.defs file.

Group Configuration Files:

There are two group configuration files that store information about group and group password. These files are located in the /etc directory. The files are:

  • /etc/group:

    The group file located in the /etc directory holds the information about the group account.

  • /etc/gshadow:

    The gshadow file located in the /etc directory saves the group account passwords. Since group accounts usually don't have a password, you'll see asterisk(*) for the password field.

User and Group Association:

  • Every use has a name.

  • Every user as a an ID (UID).

  • Every user automatically belong to a primary group.

  • Primary group has a name.

  • Primary group has an ID (GID).

  • Primary group has the same name as the user name.