Usermod cannot working

i install Solaris 11.2 , Oracle Corporation SunOS 5.11 11.2 April 2015

and make 2 zones for Oracle RAC

non-global zones : rac1, rac2

in zones i create group's and user's

/usr/sbin/groupadd -g 1000 oinstall
/usr/sbin/groupadd -g 1020 asmadmin
/usr/sbin/groupadd -g 1021 asmdba
/usr/sbin/groupadd -g 1022 asmoper
/usr/sbin/groupadd -g 1031 dba
/usr/sbin/groupadd -g 1032 oper

useradd -u 1101 -m -s /bin/bash -g oinstall -G dba,oper,asmdba oracle

passwd oracle

useradd -u 1100 -m -s /bin/bash -g oinstall -G asmoper,asmdba,asmadmin,dba grid

passwd grid

-------------------------

but when check user id :

[root@rac1 ~]# id oracle
uid=1101(oracle) gid=1000(oinstall)
[root@rac1 ~]# id grid
uid=1100(grid) gid=1000(oinstall)
[root@rac1 ~]#

oracle not add to groups : dba,oper,asmdba
grid not add to groups : asmoper,asmdba,asmadmin,dba

try this :

[root@rac1 ~]# usermod -g oinstall -G dba,oper,asmdba oracle
[root@rac1 ~]# usermod -g oinstall -G asmoper,asmdba,asmadmin,dba grid
[root@rac1 ~]# id oracle
uid=1101(oracle) gid=1000(oinstall)
[root@rac1 ~]# id grid
uid=1100(grid) gid=1000(oinstall)
[root@rac1 ~]#

...not understand where is problem , need a help

---------- Post updated at 07:01 PM ---------- Previous update was at 06:46 PM ----------

Oooh, sorry for my lame post ...

[root@rac1 ~]# id oracle
uid=1101(oracle) gid=1000(oinstall)
[root@rac1 ~]# id grid
uid=1100(grid) gid=1000(oinstall)
[root@rac1 ~]#

use wrong command only id ,, but when use id -ap ..output is :

[root@rac1 ~]# id -ap oracle
uid=1101(oracle) gid=1000(oinstall) groups=1000(oinstall),1021(asmdba),1031(dba),1032(oper) projid=3(default)
[root@rac1 ~]# id -ap grid
uid=1100(grid) gid=1000(oinstall) groups=1000(oinstall),1020(asmadmin),1021(asmdba),1022(asmoper),1031(dba) projid=3(default)
[root@rac1 ~]#

The /usr/bin/id needs -a to print the additional groups.

id -a oracle
/usr/xpg4/bin/id oracle
groups oracle
1 Like

yessss! thanks