Managing Users & Groups

Managing Users

In Linux, user properties encompass various attributes and settings associated with a user account. These properties define the user's identity, permissions, and environment within the system. Here are the key user properties you can manage:

  • Username

  • Password

  • UserID (UID)

  • GroupID (GID)

  • Comment

    • Additional information

    • Commonly used for full name

  • Home directory (~)

  • Default shell

User Data Files

Data is stored in /etc/passwd. Commonly there is x where the password is. Password hashes are stored in /etc/shadow.

User Management

useradd $options $username

Options: • -p, --pasword ◦ NOT RECOMMENDED • -u, --uid • -g, --gid • -s, --shell • -d, --home-dir • -c, --comment If option isn’t specified the defaults are used


Managing Groups

In Linux, group properties define the characteristics and settings associated with a group. Groups are used to manage sets of users and control their permissions and access rights. Here are the key properties of group:

  • Group name

  • Password

    • Generally not used

  • GroupID (GID)

  • Members

Group Data Files

Stored in /etc/group

Group Management

groupadd $options $groupname

Options: • -g, --gid • -p, --password If option isn’t specified the defaults are used


Users Group

To edit a user's group, witch is defaultyly built with the user, just add -G flag to useradd/usermod commands

You can use -aG flag to add group to a user.

Last updated