User Groups in Linux

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/user-groups-linux/
PINTEREST
PINTEREST
INSTAGRAM

I have heard that linux have groups. I wonder that how can use groups in linux ?

Linux user groups are used to groups users so for privilege and permission issues can be solved for multiple users easily. For example if we have a file and want to read access for 47 linux users we can use groups mechanism to group these users and give access to the newly created group.

List Current User Groups

First thing we will do is listing user groups in a linux system. We can list current user group like below

List All Groups

But if we want to list all groups those exists in linux system we can use following command.

Create Group

We can create new group to add user. New group creation canbe done like below.

LEARN MORE  Qemu Tutorial

  • We have added group named test

Remove Group

Removing an existing group can be donw with groupdel method.

  • Remove group named test

Group File

Group file is the database used by groups. Actually it is a text file like below.

  • And it is generally resides in /etc/group 
  • For the first like root is group name
  • is the password where it is stored in /etc/gshadow
  • is the group id

Add User To the Group

We can add existing user to the existing group  by using usermod command

  • usermod -a is command to add user to group
  • -G root is used to specify group
  • ismail is the user name
LEARN MORE  RabbitMQ Tutorial

Remove User From Group

We can remove existing user to the existing group  by using usermod command

  • usermod  is command to remove user from group
  • -G root is used to specify group
  • ismail is the user name
RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/user-groups-linux/
PINTEREST
PINTEREST
INSTAGRAM

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)