我是一个 Unix 新手,想知道所有组都存储在 Unix 中的哪里。我以为它们会在/etc/group文件中更新,但是当我读取该文件时,它并没有包含所有内容。而getent group命令显示所有组以及每个组中关联的用户。
我知道每个用户都有一个主要组,该组将存储在/etc/passwd(通常在字段 4 中),并且可能有一个或多个补充组。只有补充团体协会在/etc/group
所以,这是我的问题。
我是否有所有组都存储在中的错误印象/etc/group?
如果是这样,这三个命令有什么区别
?cat /etc/group
b. groups
C。getent group
为什么我使用该命令时能够看到的组数量getent groups多于cat /etc/group?
请告诉我。
getent读取数据/etc/groups以及为您的系统配置的任何其他数据库源。对于 Solaris 系统,它存储在 SMF 中:
$ svcprop -p config name-service/switch
config/automount astring files\ ldap
config/default astring files
config/group astring files\ ldap
config/host astring files\ dns
config/netgroup astring ldap
config/password astring files\ ldap
config/value_authorization astring solaris.smf.value.name-service.switch
Run Code Online (Sandbox Code Playgroud)
对于linux系统,请查看/etc/nsswitch.conf