0

One weird problem. I'm trying to add one user(say myuser) to a group (linuxadmins), but get following error.

sudo usermod -a -G linuxadmins myuser
usermod: group 'linuxadmins' does not exist

Then I try to troubleshoot but found group is not found in group database file but can be returned by getent search. You can find the 1st line (linuxadmins:x:1000:some_ids) of it's return and the dump snippet of /etc/group. Anyone has any ideas on where does this group come from?

[my_sit@myhost /]$ getent group
linuxadmins:x:1000:some_ids
root:x:0:my_sit,other_sit
bin:x:1:bin,daemon
daemon:x:2:bin,daemon

[my_sit@myhost /]$ cat /etc/group
root:x:0:my_sit,other_sit
bin:x:1:bin,daemon
daemon:x:2:bin,daemon
0

/etc/group is not the only source of group information.

  1. All lookups first go through the nscd cache daemon. If nscd has cached a group that was subsequently removed, it'll still show up.

  2. Then the modules configured in /etc/nsswitch.conf are used. The "files" module reads from /etc/group, but there may be others such as "ldap", "nis", "sss" (AD/LDAP), and so on.

You probably have this entry coming either from a network source or a caching module. Test the configured modules (from nsswitch.conf) one by one until you find the group:

getent -s files group linuxadmins
getent -s ... group linuxadmins

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.