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)

Encrypted Home Directories


The example in Chapter 2 discussed how to get PAM to mount encrypted home directories transparently as you log in. Both Linux and OpenBSD support encrypted home directories, but the configuration is slightly different. The previous chapters have provided the background, and it is time to return to the example in order to understand it.

The authentication configuration can be boiled down to this(the /etc/pam.d/common-auth file in many current Linux distributions):

  auth required pam_unix.so nullok_secure
  auth optional pam_mount use_first_pass

The first line does the actual authentication of the user. The classic UNIX style (pam_unix) is chosen, but it is not hard to imagine using another back end, for example, LDAP or NIS. It is required that the user is authenticated, and if the user is either not found or the password is wrong, the login is rejected. In the second line, the password from the first module (pam_unix.so) is reused (the use_first_pass option), and...