Book Image

Pluggable Authentication Modules: The Definitive Guide to PAM for Linux SysAdmins and C Developers

By : Kenneth Geisshirt
Book Image

Pluggable Authentication Modules: The Definitive Guide to PAM for Linux SysAdmins and C Developers

By: Kenneth Geisshirt

Overview of this book

<p>PAM-aware applications reduce the complexity of authentication. With PAM you can use the same user database for every login process. PAM also supports different authentication processes as required. Moreover, PAM is a well-defined API, and PAM-aware applications will not break if you change the underlying authentication configuration.<br /><br />The PAM framework is widely used by most Linux distributions for authentication purposes. Originating from Solaris 2.6 ten years ago, PAM is used today by most proprietary and free UNIX operating systems including GNU/Linux, FreeBSD, and Solaris, following both the design concept and the practical details. PAM is thus a unifying technology for authentication mechanisms in UNIX. <br /><br />PAM is a modular and flexible authentication management layer that sits between Linux applications and the native underlying authentication system. PAM can be implemented with various applications without having to recompile the applications to specifically support PAM.</p>
Table of Contents (13 chapters)

PAM File System Layout


Before we begin our tour into the world of PAM configurations we should take a look at where PAM files are stored.

The PAM-aware applications are linked against the PAM library. This library is typically located in the /lib directory with the name libpam-X.so.0 where X is the version number. Typically, it is a symbolic link to the real library, which makes it easier to have more than one version installed. If you're an application developer who wishes to use PAM in your application, you will find the relevant header file as the file named pam_modules.h in the /usr/include/security directory.

Any PAM implementation consists of a set of modules. The modules are shared objects (.so files), which can be dynamically loaded as the PAM configuration requests them. The shared objects are typically located in /lib/security (GNU/Linux), or /usr/lib (FreeBSD) and have pam as suffix in their names.

The configuration of PAM can be done in two equivalent ways. You can either put everything...