Remove a user from a secondary group

2009-10-06 Thread CHAPLIN, JAMES (CTR)
I know how to add a user to a second group, for example to give su
authority (using wheel)to a user, we issue the following command:
usermod -G wheel testur4

But how can I remove him in a single command without directly editing
the /etc/group  /etc/gshadow files (vigr). Is there a single command?

James Chaplin
Systems Programmer, MVS, zVM  zLinux
Base Technologies, Inc
Supporting the zSeries Platform Team

--
For LINUX-390 subscribe / signoff / archive access instructions,
send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390


Re: Remove a user from a secondary group

2009-10-06 Thread McKown, John
 -Original Message-
 From: Linux on 390 Port [mailto:linux-...@vm.marist.edu] On 
 Behalf Of CHAPLIN, JAMES (CTR)
 Sent: Tuesday, October 06, 2009 11:06 AM
 To: LINUX-390@VM.MARIST.EDU
 Subject: Remove a user from a secondary group
 
 I know how to add a user to a second group, for example to give su
 authority (using wheel)to a user, we issue the following command:
 usermod -G wheel testur4
 
 But how can I remove him in a single command without directly editing
 the /etc/group  /etc/gshadow files (vigr). Is there a single command?
 
 James Chaplin

Assuming that I haven't gone totally insane.

usermod -a -G newgroup existinguser #add newgroup

usermod -G oldgroup existinguser #remove oldgroup

--
John McKown 
Systems Engineer IV
IT

Administrative Services Group

HealthMarkets(r)

9151 Boulevard 26 * N. Richland Hills * TX 76010
(817) 255-3225 phone * (817)-961-6183 cell
john.mck...@healthmarkets.com * www.HealthMarkets.com

Confidentiality Notice: This e-mail message may contain confidential or 
proprietary information. If you are not the intended recipient, please contact 
the sender by reply e-mail and destroy all copies of the original message. 
HealthMarkets(r) is the brand name for products underwritten and issued by the 
insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance 
Company(r), Mid-West National Life Insurance Company of TennesseeSM and The 
MEGA Life and Health Insurance Company.SM

 

--
For LINUX-390 subscribe / signoff / archive access instructions,
send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390


Re: Remove a user from a secondary group

2009-10-06 Thread Mark Post
 On 10/6/2009 at 12:06 PM, CHAPLIN, JAMES (CTR)
james.chap...@associates.dhs.gov wrote: 
 I know how to add a user to a second group, for example to give su
 authority (using wheel)to a user, we issue the following command:
 usermod -G wheel testur4
 
 But how can I remove him in a single command without directly editing
 the /etc/group  /etc/gshadow files (vigr). Is there a single command?

When you use usermod -G group1,group2,group3 username, any groups that 
username is a member of, but are not listed on the command, are removed.  I.e., 
each usermod -G command must specify _all_ the groups you want them to be in.


Mark Post

--
For LINUX-390 subscribe / signoff / archive access instructions,
send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390


Re: Remove a user from a secondary group

2009-10-06 Thread CHAPLIN, JAMES (CTR)
Thanks Mark, . . . that's the answer, and I did not know this.

James Chaplin
Systems Programmer, MVS, zVM  zLinux
Base Technologies, Inc
-Original Message-
From: Linux on 390 Port [mailto:linux-...@vm.marist.edu] On Behalf Of
Mark Post
Sent: Tuesday, October 06, 2009 2:33 PM
To: LINUX-390@VM.MARIST.EDU
Subject: Re: Remove a user from a secondary group

 On 10/6/2009 at 12:06 PM, CHAPLIN, JAMES (CTR)
james.chap...@associates.dhs.gov wrote: 
 I know how to add a user to a second group, for example to give su
 authority (using wheel)to a user, we issue the following command:
 usermod -G wheel testur4
 
 But how can I remove him in a single command without directly editing
 the /etc/group  /etc/gshadow files (vigr). Is there a single command?

When you use usermod -G group1,group2,group3 username, any groups that
username is a member of, but are not listed on the command, are removed.
I.e., each usermod -G command must specify _all_ the groups you want
them to be in.


Mark Post

--
For LINUX-390 subscribe / signoff / archive access instructions,
send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or
visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

--
For LINUX-390 subscribe / signoff / archive access instructions,
send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390