List Info

Thread: To remove a member from a group in /etc/group




To remove a member from a group in /etc/group
user name
2006-11-29 17:46:32
On 11/28/2006 9:24 AM, d.qureshimdx.ac.uk wrote:

> > I have added a userid called fred1 to a group
called wheel using the following command on my Linux
server:-
> > 
> > # usermod -G wheel fred1
> > 
> > The above userid now appears in the /etc/group
file as
> > 
> > wheel:10:r
oot,fred1
> > 
> > How do I remove the userid fred1 from the group
called wheel?
>   

I can't believe that 3 people all gave you a hard answer
today   

# man gpasswd

	.../Ed

-- Ed Wilts, Mounds View, MN, USA mailto:ewiltsewilts.org


___________________________________________________________

Could just run

usermod -G "" fred1


USERMOD(8)
       -G group,[...]
              A  list  of  supplementary  groups which the
user is also 
a member of.  Each group is separated from the next by a
comma,
              with no intervening whitespace.  The groups
are subject to 
the same restrictions as the group given with the  -g 
option.
              If the user is currently a member of a group
which is not 
listed, the user will be removed from the group. This
behaviour
              can be changed via -a option, which appends
user to the 
current supplementary group list.



-- 
Thanks,
Jonathan


System Administrator     NOAA PMEL OERD
Newport, OR       <+>   

--
nahant-list mailing list
nahant-listredhat.com
h
ttps://www.redhat.com/mailman/listinfo/nahant-list
To remove a member from a group in /etc/group
user name
2006-11-29 18:16:28
On 11/29/06, Jonathan Klay <Jonathan.Klaynoaa.gov> wrote:
> Could just run
>
> usermod -G "" fred1

That might remove fred1 from more than just the wheel
group?!

While I'm not sure I would characterize removing 6
characters from a
file as hard, I can't argue with Ed's suggested solution
which does
exactly what was requested in a very straightforward way. If
the price
of suggesting hard solutions is learning easy solutions, I'm
willing
to pay that price any day. 

John

--
nahant-list mailing list
nahant-listredhat.com
h
ttps://www.redhat.com/mailman/listinfo/nahant-list
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )