Linux Group Management (Collection of Users) Print

  • user group, linux group, linux user group, user management, group management
  • 13

Groups are a collection of users. Assigning users to groups makes it easier to manage permissions. For example, you can set permissions to ensure that files are accessible to people in a particular group like accounts, hr, etc. Whenever a user is created, by default, they are added to a new group with the same name as the username. This is called the primary group of the user.

Config files: /etc/group & /etc/gshadow

Information about group is stored in the /etc/group file.
eg: mail:x:12:postfix,exim

The first part is the name of the group.
x is a placeholder for password.
The next part is the group ID.
The last part is a comma-separated list of usernames that belong to that group.

Adding new group: groupadd groupname

Change Group ID: groupmod -g 300 groupname [It will change group id from existing id to 300]

Change Group name: groupmod -n groupname newgroupname

Delete a Group: groupdel groupname

Add an user to a Group: gpasswd --add john85 groupname

Add Group Admin: gpasswd --administrators john85 groupname


Was this answer helpful?

« Back

Powered by WHMCompleteSolution