LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-11-2020, 09:54 AM   #1
nikolaymartin
LQ Newbie
 
Registered: May 2019
Posts: 9

Rep: Reputation: Disabled
Remove A User From the specific Group In Linux


How can I remove a specific user from the group?
 
Old 05-11-2020, 10:08 AM   #2
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: A few
Posts: 4,789

Rep: Reputation: 1425Reputation: 1425Reputation: 1425Reputation: 1425Reputation: 1425Reputation: 1425Reputation: 1425Reputation: 1425Reputation: 1425Reputation: 1425
The name is misleading, but it works:
Code:
# gpasswd --help
Usage: gpasswd [option] GROUP

Options:
  -a, --add USER                add USER to GROUP
  -d, --delete USER             remove USER from GROUP
  -h, --help                    display this help message and exit
  -Q, --root CHROOT_DIR         directory to chroot into
  -r, --delete-password         remove the GROUP's password
  -R, --restrict                restrict access to GROUP to its members
  -M, --members USER,...        set the list of members of GROUP
  -A, --administrators ADMIN,...
                                set the list of administrators for GROUP
Except for the -A and -M options, the options cannot be combined.

Last edited by berndbausch; 05-11-2020 at 10:08 AM. Reason: formatting
 
Old 05-16-2020, 04:30 PM   #3
jmgibson1981
Member
 
Registered: Jun 2015
Location: Tucson, AZ USA
Distribution: Debian
Posts: 484

Rep: Reputation: Disabled
Another way, deluser. Replace "$USER" and "$GROUP" with appropriate ones respectively.

Code:
# deluser "$USER" "$GROUP"
From deluser man page.

Quote:
Remove a user from a specific group
If called with two non-option arguments, deluser will remove a user
from a specific group.

Last edited by jmgibson1981; 05-16-2020 at 04:31 PM.
 
  


Reply

Tags
group, linux


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Permission on specific Directory / File to specific group AbidDhanaiser Linux - Desktop 1 08-28-2013 03:38 AM
Block bitmap for group 416 not in group (block 0) + group descriptors corrupted? quanta Linux - Server 1 12-08-2010 10:40 AM
group: add complete group into other group max_mad SUSE / openSUSE 1 04-12-2006 01:43 AM
How to make a specific command(s) work for specific users or group only naren_0101bits Linux - General 3 08-28-2005 05:22 PM
Group Admin, Group Root, or God over Group crickett Linux - General 5 07-12-2004 04:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration