Operating System - Linux
1752686 Members
5509 Online
108789 Solutions
New Discussion юеВ

how to modify the primary & secondary group

 
SOLVED
Go to solution
jona_1
Frequent Advisor

how to modify the primary & secondary group

HI,
OS Red Hat Enterprise Linux Server release 5.5
My id is like this

-bash-3.2# id jona
uid=8398338(jona) gid=45005(uxsup3) groups=45005(uxsup3)
-bash-3.2#
I am not getting root access. for root access i hv to set my id as below. because this user (hpyriche) has the root access

-bash-3.2# id hpyriche
uid=47162(hpyriche) gid=45045(ermusers) groups=45045(ermusers)
-bash-3.2#

So i want to change my primary group & secondary group like the user hpyriche, so that i can get the root access. What will be the command

Regards,
Jona
2 REPLIES 2
Matti_Kurkela
Honored Contributor
Solution

Re: how to modify the primary & secondary group

"usermod -g" can be used to set primary group, i.e.

usermod -g ermusers jona

To set secondary group(s), you can use "usermod -G". You can have multiple secondary groups if you wish.

Since "id" lists the same group as "gid=" and "groups=", neither you nor hpyriche apparently have any secondary groups. So the command above may be enough for your situation.

To make "jona" a secondary member of "ermusers":

usermod -G ermusers jona

To make "jona" a secondary member of both ermusers and uxsup3 groups:

usermod -G ermusers,uxsup3 jona

MK
MK
jona_1
Frequent Advisor

Re: how to modify the primary & secondary group

Thank you Sir
Regards,
jona