Output of getent group

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?

2 Answers

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).

1

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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like