0

I am little puzzled with below outcome. I am logged in as root and created 2 new user. tecmint and tecmint2. New user became part of group that I cant find in /etc/group. How can I find out why this is happening and fix it. User added using below command.

root@uklvadsb0047[DEV][~] # useradd -G ldap tecmint2

The GID 55 is ldap but it shows as dba when I list user using id command

root@uklvadsb0047[DEV][~] # cat /etc/group | grep 100
users:x:100:
tecmint:x:1000:
tecmint2:x:1001:
root@uklvadsb0047[DEV][~] # cat /etc/group | grep 55
ldap:x:55:tecmint,tecmint2
root@uklvadsb0047[DEV][~] # id -a tecmint2
uid=1001(tecmint2) gid=1001(jbase5) groups=1001(jbase5),55(dba)
root@uklvadsb0047[DEV][~] # id -a tecmint
uid=1000(tecmint) gid=1000(tibco) groups=1000(tibco),55(dba)

Any clue on this would be really helpful :)

Thanks, Dwija.

Added a few more lines on searching group name from files under /etc

root@uklvadsb0047[DEV][~] # grep -rnw '/etc' -e 'tecmint' /etc/group:63:ldap:x:55:tecmint,tecmint2 /etc/group:64:tecmint:x:1000: /etc/gshadow:63:ldap:!::tecmint,tecmint2 /etc/gshadow:64:tecmint:!:: /etc/passwd:38:tecmint:x:1000:1000::/home/tecmint:/bin/bash /etc/group-:63:ldap:x:55:tecmint /etc/group-:64:tecmint:x:1000: /etc/gshadow-:63:ldap:!::tecmint /etc/gshadow-:64:tecmint:!:: /etc/shadow:38:tecmint:$6$DsZ1ssCj$GjgFqqrliSo5u6jxwfY /etc/subgid:1:tecmint:100000:65536 /etc/passwd-:38:tecmint:x:1000:1000::/home/tecmint:/bin/bash /etc/subuid:1:tecmint:100000:65536 /etc/shadow-:38:tecmint:$6$DsZ1ssCj$GjgFqqrliSo5u6jxwfYiG /etc/subgid-:1:tecmint:100000:65536 /etc/subuid-:1:tecmint:100000:65536 root@uklvadsb0047[DEV][~] # grep -rnw '/etc' -e 'jbase5'

root@uklvadsb0047[DEV][~] # grep -rnw '/etc' -e 'dba' Binary file /etc/selinux/targeted/active/modules/100/mandb/hll matches Binary file /etc/udev/hwdb.bin matches

root@uklvadsb0047[DEV][~] # grep -rnw '/etc' -e 'tibco'

No result from any files under /etc/ by searching above group name.

Dwija
  • 21
  • 4
  • Look for `dba` in the `/etc/group` file. – Michael Hampton Jul 14 '20 at 13:15
  • Thanks for your reply. Here is output grep. It seems the /etc/group is not correct place to refer for RHEL 7.x as the group not present there yet new user get tagged to. `infra1@uklvadsb0047[DEV][~] $ cat /etc/group | grep dba` `infra1@uklvadsb0047[DEV][~] $` – Dwija Jul 14 '20 at 17:18
  • Did you also check the `/etc/gshadow` file? – Michael Hampton Jul 14 '20 at 17:46
  • could add long comment. instead I updated the original post. I cant find those group name anywhere. – Dwija Jul 15 '20 at 11:03

1 Answers1

1

The reason is that on networked systems, groups may not only read from /etc/group file, but also obtained through LDAP or Yellow Pages (the list of known groups comes from the local group file plus groups received via LDAP or YP in these cases). If you want just the group names you can use:

getent group | cut -d: -f1

Above from this page explains why I cant see group name in local server but ID's are assigned to.

https://stackoverflow.com/questions/14059916/is-there-a-command-to-list-all-unix-group-names

getent group - I used this command to list of groups available and it showed the group that I was looking for.This test server is part of a LDAP network and group names were fetched from LDAP. so the mystery solved.

root@uklvadsb0047[DEV][~] # getent group | grep -e tibco -e jbase5 -e dba
asmdba:x:59:
dba:x:55:
jbase5:x:1001:
tibco:x:1000:

thank you @Michael for your replies. Next is to search how to prevent use group name from LDAP and use local group name.

Dwija
  • 21
  • 4