HomeLinuxAdd or Take away a Person from a Group in Linux

Add or Take away a Person from a Group in Linux


Linux is by default a multi-user system (which means many customers can connect with it concurrently and work), thus Linux person administration is without doubt one of the basic duties of a system administrator, which incorporates all the pieces from creating, updating, and deleting person accounts or person teams on a Linux system.

On this brief fast article, you’ll discover ways to add or take away a person from a gaggle in a Linux system.

Test a Person Group in Linux

To verify a person group, simply run the next teams command and supply the username (tecmint on this instance) as an argument.

# teams tecmint

tecmint : tecmint wheel

To verify your individual teams, simply run the teams command with none argument.

# group

root
Check a User Group in Linux
Test a Person Group in Linux

Add a Person to a Group in Linux

Earlier than making an attempt so as to add a person to a group, be certain that the person exists on the system. So as to add a person to a sure group, use the usermod command with the -a flag which tells the usermod so as to add a person to the supplementary group(s), and the -G possibility specifies the precise teams within the following format.

On this instance, tecmint is the username and postgres is the group title:

# usermod -aG postgres tecmint
# teams tecmint
Add User to Group in Linux
Add Person to Group in Linux

Take away a Person from a Group in Linux

To take away a person from a gaggle, use the gpasswd command with the -d possibility as follows.

# gpasswd -d tecmint postgres
# teams tecmint
Remove User from Group in Linux
Take away Person from Group in Linux

Moreover, on Ubuntu and it’s by-product, you may take away a person from a particular group utilizing the deluser command as follows (the place tecmint is the username and postgres is the group title).

$ sudo deluser tecmint postgres

For extra info, see the person pages for every of the completely different instructions we’ve got used on this article.

Additionally, you will discover the next person administration guides very helpful:

If You Admire What We Do Right here On TecMint, You Ought to Think about:

TecMint is the quickest rising and most trusted neighborhood web site for any type of Linux Articles, Guides and Books on the net. Hundreds of thousands of individuals go to TecMint! to look or browse the hundreds of printed articles out there FREELY to all.

In the event you like what you’re studying, please think about shopping for us a espresso ( or 2 ) as a token of appreciation.

Support Us

We’re grateful to your by no means ending help.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments