During the last days I've been fiddling around with LDAP authentication and I've managed to configure some Linux systems (CentOS 6 and 7) to perform the SSH authentication process против сервера OpenLDAP (который я также установил и настроил). Однако, несмотря на то, что все работает так, как я предполагал, есть кое-что об аутентификации LDAP. process that is bugging me.
What I don't quite understand is how PAM and NSS work with each other and how they interact with one another. After researching about the theme, I came to the conclusion that (Reference):
But what is the authentication flow? How are the files/services that I configured used (/etc/nsswitch.conf, /etc/nslcd.conf, /etc/nscd.conf/, /etc/pam.d/password-auth) and in what order?
Note: If I remove from "nsswitch.conf" the line correspondent to the shadow database, the authentication process still works without any problem. This means that the file "nsswitch.conf" is never used for obtaining the sources for password lookups?
В зависимости от конфигурации,LDAP не требует теневой базы данных. Есть два распространенных варианта:
NSS предоставляет доступ к ряду баз данных имен, таких как пароль, хосты, службы и группы. Поиск может выполняться из множества источников, включая файлы и LDAP. Он может взаимодействовать с демоном кэширования для хранения локальных копий недавно использованных данных.
PAM обеспечивает аутентификацию на основе ряда правил. В зависимости от версии он может иметь отдельный модуль LDAP, или его модуль пароля будет знать LDAP и сможет аутентифицироваться по LDAP.