PAM (Pluggable Authentication Modules) is a library that makes the task of authenticating a user easier for application developers. Instead of writing a backend for every authentication library (kerberos, shadow, ldap etc.) you only have to write an interface for pam.