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)

Consolidating Your PAM Configuration


Most services need to be configured in the same way, that is the authentication of valid users is done in exactly same way, and it is obviously a bad idea to have replicates of the configuration for all services.

Many, but not all, PAM implementations allow you to consolidate the configuration. From version 0.78 of Linux-PAM (released November 2004), it has been possible to use the @include directive. As you might guess, the @include directive can take the contents of another file and include these in the current file. Ubuntu Linux utilizes consolidation of PAM configuration heavily. An example for the ppp service is given below:

#%PAM-1.0
# Information for the PPPD process with the 'login' option.
auth    required        pam_nologin.so
@include common-auth
@include common-account
@include common-session

The file /etc/pam.d/common-auth contains common or shared configuration for the auth management group, and so forth with the account and session groups...