I cross compiled Linux-PAM and OpenLDAP for my linux embedded system (with ARM architecture) and copied the compiled files and folders into it. I create a /etc/pam.d/ folder and i put inside of it the files common-auth, common-password and common-account. How can i make sure it authenticates with PAM? For example from the command line when I digit:

su user1

how can I make sure the system authenticate only with passwd or with PAM?

This are the files I put inside the /etc/pam.d folder:


account sufficient    /usr/lib/security/pam_ldap.so
account required    /lib/security/pam_unix.so try_first_pass


auth sufficient        /usr/lib/security/pam_ldap.so
auth required        /lib/security/pam_unix.so nullok_secure try_first_pass


password sufficient    /usr/lib/security/pam_ldap.so
password required    /lib/security/pam_unix.so nullok obscure min=4 max=8 md5 try_first_pass

Thanks for your help.

1 Answer 1


If you're using

auth sufficient        /usr/lib/security/pam_ldap.so
auth required        /lib/security/pam_unix.so nullok_secure try_first_pass

the module pam_ldap.so is tried first and authc will succeed if it returns PAM_SUCCESS. If not pam_unix.so will be tried next and login will fail if it does not return PAM_SUCCESS.

You can define more complex setups with the various PAM modules available. Please examine the PAM docs very carefully for not punching security holes in your setup.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .