![그룹 데이터베이스의 [Succes=return]에서 nsswitch.conf에 추가해야 할 사항](https://linux55.com/image/202179/%EA%B7%B8%EB%A3%B9%20%EB%8D%B0%EC%9D%B4%ED%84%B0%EB%B2%A0%EC%9D%B4%EC%8A%A4%EC%9D%98%20%5BSucces%3Dreturn%5D%EC%97%90%EC%84%9C%20nsswitch.conf%EC%97%90%20%EC%B6%94%EA%B0%80%ED%95%B4%EC%95%BC%20%ED%95%A0%20%EC%82%AC%ED%95%AD.png)
GlibC 2.17을 사용하여 CentOS 시스템에서 작업하는 동안 원격 디렉터리에서 로컬 사용자 그룹 조회를 비활성화하는 구성을 찾는 데 어려움을 겪고 있습니다.
그룹 조회의 설계는 모든 디렉터리를 검색하는 것이라는 것을 알고 있지만 추가하면 group: file [SUCCESS=return]
이 문제가 해결될 것이라고 생각합니다.
하지만 그렇지 않은 것 같습니다 :(
그러다가 도움이 될 수도 있겠다고 생각했는데 initgroups
소용이 없는 것 같더라고요initgroups: files [SUCCESS=return] nis ldap
내 거nsswitch.conf
passwd: compat ldap
shadow: files
group: files nis ldap
hosts: files dns nis
protocols: files
rpc: files
services: files
initgroups: files [SUCCESS=return] nis ldap
internal_getgrouplist
이것은 glibc 함수의 코드 조각입니다.
80 if (__nss_initgroups_database == NULL)
81 {
82 if (__nss_database_lookup2 ("initgroups", NULL, "",
83 &__nss_initgroups_database) < 0)
84 {
85 if (__nss_group_database == NULL)
86 no_more = __nss_database_lookup2 ("group", NULL, DEFAULT_CONFIG,
87 &__nss_group_database);
88
89 __nss_initgroups_database = __nss_group_database;
90 }
91 else
92 use_initgroups_entry = true;
93 }
...
133 /* For compatibility reason we will continue to look for more
134 entries using the next service even though data has already
135 been found if the nsswitch.conf file contained only a 'groups'
136 line and no 'initgroups' line. If the latter is available
137 we always respect the status. This means that the default
138 for successful lookups is to return. */
139 if ((use_initgroups_entry || status != NSS_STATUS_SUCCESS)
140 && nss_next_action (nip, status) == NSS_ACTION_RETURN)
141 break;
142
143 if (nip->next == NULL)
144 no_more = -1;
145 else
146 nip = nip->next;
147 }
구성을 존중해야 할 것 같지만 initgroups
그렇지 않은 것 같습니다. nsswitch.conf에서 완전히 제거하려고 시도했지만 group:
성공하지 못했습니다. id
로컬 사용자에 대한 명령이 여전히 중단됩니다.
이 문제를 해결할 방법이 있나요?
내 경우에는 원격 디렉터리 포트가 차단되거나 원격 디렉터리의 응답 속도가 느린 경우 조회를 수행하는 서비스가 완전히 중단되었습니다. 당사 제품에는 최종 사용자가 구성할 수 없는 기본 nsswitch.conf가 함께 제공됩니다.
그룹 조회가 이 원격 조회 서비스로 이동하기 때문에 로컬 사용자도 로그인할 수 없습니다.