How to Add a User to the Group in Linux

1

Linux is a multi-user working machine the place person permissions will also be specified for each and every person. However, this will also be problematic if there are a number of customers and all are having the similar rights and privileges. Because a couple of customers can attach and paintings on the similar time and so they will have to have the privileges as according to their wisdom and revel in. So, person control is likely one of the maximum essential tasks of a machine administrator which encompasses the whole lot from growing, updating, and deleting person accounts and person teams.

How so as to add customers to the crowd the use of the terminal in Linux

Let’s get started with growing a brand new person first in order that we will upload them into the crowd through following the overall syntax proven underneath.

For instance:

Now let’s create a brand new organization the use of the overall syntax proven underneath.

$ sudo groupadd group-name

For instance:

$ sudo groupadd linuxhintgroup

Now the overall syntax so as to add any person to the crowd is:

$ sudo usermod -a -G group-name user-name

To upload the person ‘linuxhint’ within the organization ‘linuxhintgroup’, use the underneath discussed command:

$ sudo usermod -a -G linuxhintgroup linuxhint

Here ‘-a’ choice represents the addition procedure while ‘-G’ choice represents the crowd choice and ‘usermod’ displays that we’re coping with a person so as to add within the explicit organization, and on the finish we’ve written the crowd call first after which the username.

Now in the event you like to ensure that if a person is added to the crowd or no longer then you’ll be able to do this through following the overall syntax discussed underneath.

$ grep user_name /and so forth/organization

For instance:

$ grep linuxhint /and so forth/organization

In the above command ‘grep’ is used to seek out the particular key phrase from any report like in our case we’ve discussed the key phrase ‘linuxhintgroup’ at the side of a filename ‘/etc/group’ from the place it’ll to find that key phrase. By any likelihood, if you wish to get admission to this report then you’ll be able to do this through typing:

You too can examine if the person has been added to a gaggle or no longer through putting in a third-party utility with the call of “members” through typing:

$ sudo apt set up contributors

After the set up, the overall syntax that can be utilized to seek out the contributors in any organization is:

For instance:

As you’ll be able to see, the above instructions display just one person which is ‘linuxhint’.

There is one different approach to to find the customers in any organization and you’ll be able to do this through following the overall syntax proven underneath.

For instance:

The above command will seek the entire to be had teams after which it’ll display you that exact organization the place “linuxhint” is to be had.

How so as to add customers to the crowd the use of GUI in Linux

We are recently the use of Linux mint the place you’ll be able to additionally upload the person to the crowd through settling on the ‘Users and Groups’ choice that you’ll be able to to find within the settings of your Linux distribution as proven underneath.

After that, you want to give you the password for authentication and later a brand new discussion field will open the place you want to make a choice the ‘Groups’ tab after which upload any organization that you simply like through clicking at the ‘Add’ button as proven underneath.

After growing a brand new organization, your next step is to assign a person to this organization, and you’ll be able to do this through settling on the ‘Users’ tab and the brand new person with the call of ‘linuxhint’.

Now, all you want is to click on at the organization tab and choose the particular organization the place you wish to have to affiliate a person as proven underneath.

Conclusion

Linux is a multi-user working machine during which each and every person will have their very own set of permissions. This is a vital step as a result of person privileges will have to be in accordance with their wisdom and experience differently it may be problematic. In this newsletter, we’ve defined two other ways so as to add customers within the organization that may both be the use of a terminal or it will also be carried out the use of a GUI.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More