mogoz

PAM

tags
ulimits , Linux

Intro

  • PAM is basically an auth system.
  • When some process tries a username/password combo, pam can decide to allow/reject access.
  • Typically /etc/passwd and /etc/shadow is used by default to check the password attempt.
  • But this can be configured to use other systems like LDAP or anything else you make a module for and configure it with PAM.
  • It is largely used in Directory Services
  • PAM also provides other functions, beyond authentication
    • Access control (authorization)
    • Session setup
    • Password changes

PAM and LDAP

  • NSCD to handle user, group, dns, caching.
  • Kerberos w LDAP server
    • pam_ldap for user look-ups
    • pam_krb5 for authn and authz.
  • PAM and NSS can talk to LDAP directly using pam_ldap and nss_ldap , but SSSD has benifits.

SSSD

  • System Security Services Daemon
  • Instead of directly configuring LDAP, one can use SSSD.
  • It has NSS and PAM modules. The modules communicate with the corresponding SSSD responders. SSSD responders talk to the SSSD Monitor. Look up the user in LDAP, uses Kerberos KDC for authN etc.
  • Advantage is that it handles everything in a centralised place.
  • It provides offline support via its cache. Caching might conflict with nscd

Why PAM is a mess now?

  • It seems like it tries to support a lot of things out of the box that may not be relevant these days, like mail and limits.
  • Cleartext?? It is plaintext???

Different implementations

  • Original PAM
  • Linux PAM
  • OpenPAM (Used by BSD)

How is authentication handled? (Steps)

Links to this note