Question Locked
0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
How can I remove a specific user from the group?
1 reply
by rvkanth1996 Accepted solution
Use usermod to remove users from the group
We can use the usermod command to exclude a user from one or more groups at a time. When using usermod, you must specify which auxiliary groups you want to keep the user in. Let me illustrate with an example.
$ group test users
testuser: testuser testgroup1 testgroup2 root
To remove the user "testuser" from the "testgroup1" and "testgroup2" groups, run the following command (that is, just keep testuser in the "root" group, which is the main "testuser" group):
$ sudo usermod -G root testuser
result
$ group test users
testuser: testuser root directory
This discussion is closed to new replies.
Trending Linux posts
Sort by Trending
0 helpful
7 replies
0 helpful
6 replies
Question Locked
RE: How to fix the Docker and UFW security flaw
0 helpful
3 replies
Discussion Locked
Which Linux works best on old phone or tablet?
0 helpful
5 replies
Discussion Locked
My Job and Company
0 helpful
3 replies