14

Similar to This question, but different result set, can anyone help me with the output of getent group?

It's something like this:

groupname:x:0:

just not sure what the x:0: signifies?

twitchd8
  • 147
  • 1
  • 2
  • 9

2 Answers2

14
getent group <group_name>

queries the /etc/group file and gets the entry for the mentioned group from the file.

The output format is:

group:password:GID:user(s)
  • group is the group's name
  • password is the encrypted group password, empty field signifies no password, x bit signifies the password is in the file /etc/gshadow

  • GID is the Group ID

  • user(s) is the list of users member of this group, empty means this group has no member.

Now, if you check the /etc/gshadow file you will see that the group password is locked (! or *) in the password field, thats because the group password is not used. It's considered a security risk to have all members of the group share the same password. (At least i have never come across any implementation of gshadow).

heemayl
  • 90,425
  • 20
  • 200
  • 267
  • Thank you for the quick reply! This confirms what I thought, and expands on the assumptions that I made. – twitchd8 Aug 12 '16 at 15:52
0

The accepted answer is not complete. getent also reads SSSD info to get LDAP group which is not listed in /etc/group. cat /etc/nsswitch.conf and check the group line to see what group info source you have.

cat /etc/nsswitch.conf
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat systemd sss
group:          compat systemd sss
shadow:         compat sss
gshadow:        files

hosts:          files mdns4_minimal [NOTFOUND=return] dns myhostname
networks:       files

protocols:      db files
services:       db files sss
ethers:         db files
rpc:            db files

netgroup:       nis sss
sudoers:        files sss
WesternGun
  • 197
  • 7