Mailing List
Home
Forum Home
Linux - General Red Hat Linux discussion list
Enterprise Linux 3 - Discussion of Red Hat Enterprise Linux 3 (Taroon)
Installation - Getting started with Red Hat Linux
Red Hat Linux 9 - Discussion of Red Hat Linux 9 (Shrike)
Red Hat Linux 7.3 - Discussion of Red Hat Linux 7.3 (Valhalla)
Red Hat Linux 7.2 - Discussion of Red Hat Linux 7.2 (Enigma)
Apache Web Server
Oracle database, Microsoft SQL server ...
Subjects
application/x mplayer2 plugin
RPM error: db4 error(16) from dbenv >remove: Device or resource
   busy
Command stream end of file while reading
X Windows problem (xauth)
Upgrading openoffice 1 1 rpm
FTP: connection refused
FTP: connection refused
mount: /dev/cdrom: is not a valid block device
Dell Precision 650, RedHat 9, no sound
how to trace the cause resulting in the crash of bind server
Virus on the list
UNINSTALL RPM MYSQL
usb pen drives: mounting as a user
broadcom network interface
make mrproper
sendmail configuration on redhat
Couldn 't open PID file /var/run/named/named pid Permission denied
Promise 378 controller
kernel 2 6 and /dev/sound/mixer not found
Problem using up2date
mrtg step by step howto/configuration for a newbie?
Compiling and Installing Kernel 2 6
Can 't locate module ppp0, can 't locate module ppp compress 21
HOW I CAN MAKE BOOTABLE FLOPPY DISKET
Lotus Notes under Wine
/etc/security/limits conf question
Intel E/1000 driver
Command stream end of file while reading
rpm database corrupt
qla2300 modules
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
usermod

usermod

2005-03-30       - By Steve Buehler

 Back
Reply:     1     2     3     4     5     6     7     8     9     10  

At 08:50 AM 3/30/2005, McDougall, Marshall (FSH) wrote:
>> >>I know you can use "usermod" on RedHat Linux to add a user to another
>>group
>> >>by typing:
>> >>usermod -G sam,frank steve
>> >>This would effectively add steve to the "frank" and "sam" group.  How do
>> >>you remove them from those groups without editing the /etc/group file
>> >>manually?  I can do:
>> >>usermod -G steve steve
>> >>That will remove him from "sam" and "frank" groups but would add steve to
>> >>his own group so the /etc/group file would look like:
>> >>steve:x:590:steve
>> >>instead of just:
>> >>steve:x:590:
>> >>For the life of me, I can't figure this one out.  Does anybody know?
>>
>> >If you "usermod -G sam,frank steve" and realize that you shouldn't have put
>> >steve in the frank group, just "usermod -G sam steve" and by omission, will
>> >remove the user from the group.  HTH
>>
>>Yes, but what if I want to remove him from both groups.  You can't type
>>"usermod -G steve".  Basically, I am wanting to remove him from ALL groups
>>except for his initial group.  And "usermod -g steve steve" will not do it
>>either.  The "-G" must have atleast one group as an
>>option..................................I just tried something that seems
>>to work, but not sure if it is suppose to work this way.  I typed:
>>usermod -G "" steve
>>and that removed steve from all extra groups.  So either my problem is
>>solved, or there is another "proper" way of doing it.
>
>"usermod -Gsteve steve" should remove him from all groups except steve.  If
>the group is in the list, then the user is added to the group.  If the group
>is not in the list, then the user is removed from any groups not in the
>list.  This is the way I go about it.  We all know that with *nix, there is
>always more than 1 way to accomplish it.

I know it shouldn't hurt to do that, but if you do, it actually adds steve
to his own group again.  So instead of the line in the /etc/group file
looking like the following which is how it should look if they are not in
any other group:
steve:x:590:
it would then look like the following if you run "usermod -Gsteve steve":
steve:x:590:steve

Thanks
Steve



--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@(protected)?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

Earn $52 per hosting referral at Lunarpages.