How are PAM modules organized and stored?
A. As plain text files in /etc/security/
B. A statically linked binaries in /etc/pam. d/bin/
C. As Linux kernel modules within the respective sub directory of / lib/modules/
D. As shared object files within the / lib/ directory hierarchy
E. As dynamically linked binaries in /usr/lib/pam/sbin/
Please check that link: https://www-uxsup.csx.cam.ac.uk/pub/doc/redhat/redhat7.3/rhl-rg-en-7.3/s1-pam-module-paths.html
I think the correct answer is D, the module indicated is assumed to be in the /lib/security/ directory — the default location for PAM.
lab@lab:~$ locate pam_nologin.so
/lib/x86_64-linux-gnu/security/pam_nologin.so
/snap/core/9066/lib/x86_64-linux-gnu/security/pam_nologin.so
/snap/core/9289/lib/x86_64-linux-gnu/security/pam_nologin.so
lab@lab:~$
I think the answer should be “D”. If you check any of the configuration files that are located in the pam.d, you will see that different directive point to pam modules that are located in /lib/x86_64-linux-gnu/security/ directory. This can be confirmed if you do a simple “locate pam_nologin.so” as an example command and you will see the full path of the pam module in your system.