/usr/share/doc/pam/html
NameSizeModeActions
Linux-PAM_SAG.html91960644editdlrm
sag-author.html31110644editdlrm
sag-configuration-directory.html29660644editdlrm
sag-configuration-example.html55220644editdlrm
sag-configuration-file.html175190644editdlrm
sag-configuration.html30650644editdlrm
sag-copyright.html36170644editdlrm
sag-introduction.html44460644editdlrm
sag-module-reference.html381520644editdlrm
sag-overview.html79950644editdlrm
sag-pam_access.html181200644editdlrm
sag-pam_cracklib.html202710644editdlrm
sag-pam_debug.html80870644editdlrm
sag-pam_deny.html47040644editdlrm
sag-pam_echo.html57520644editdlrm
sag-pam_env.html127960644editdlrm
sag-pam_exec.html83710644editdlrm
sag-pam_faildelay.html45900644editdlrm
sag-pam_filter.html93420644editdlrm
sag-pam_ftp.html62030644editdlrm
sag-pam_group.html101360644editdlrm
sag-pam_issue.html63780644editdlrm
sag-pam_keyinit.html70150644editdlrm
sag-pam_lastlog.html85240644editdlrm
sag-pam_limits.html181140644editdlrm
sag-pam_listfile.html105340644editdlrm
sag-pam_localuser.html54460644editdlrm
sag-pam_loginuid.html52090644editdlrm
sag-pam_mail.html77620644editdlrm
sag-pam_mkhomedir.html61960644editdlrm
sag-pam_motd.html77530644editdlrm
sag-pam_namespace.html206400644editdlrm
sag-pam_nologin.html53320644editdlrm
sag-pam_permit.html43040644editdlrm
sag-pam_pwhistory.html84760644editdlrm
sag-pam_rhosts.html64040644editdlrm
sag-pam_rootok.html51090644editdlrm
sag-pam_securetty.html64800644editdlrm
sag-pam_selinux.html83130644editdlrm
sag-pam_shells.html42610644editdlrm
sag-pam_succeed_if.html91540644editdlrm
sag-pam_time.html97250644editdlrm
sag-pam_timestamp.html68890644editdlrm
sag-pam_umask.html63180644editdlrm
sag-pam_unix.html150560644editdlrm
sag-pam_userdb.html85850644editdlrm
sag-pam_warn.html45690644editdlrm
sag-pam_wheel.html71810644editdlrm
sag-pam_xauth.html84200644editdlrm
sag-security-issues-other.html29930644editdlrm
sag-security-issues-wrong.html29630644editdlrm
sag-security-issues.html21610644editdlrm
sag-see-also.html22830644editdlrm
sag-text-conventions.html31870644editdlrm
Edit: /usr/share/doc/pam/html/sag-overview.html (7995B)
Chapter 3. Overview

Chapter 3. Overview

For the uninitiated, we begin by considering an example. We take an application that grants some service to users; login is one such program. Login does two things, it first establishes that the requesting user is whom they claim to be and second provides them with the requested service: in the case of login the service is a command shell (bash, tcsh, zsh, etc.) running with the identity of the user.

Traditionally, the former step is achieved by the login application prompting the user for a password and then verifying that it agrees with that located on the system; hence verifying that as far as the system is concerned the user is who they claim to be. This is the task that is delegated to Linux-PAM.

From the perspective of the application programmer (in this case the person that wrote the login application), Linux-PAM takes care of this authentication task -- verifying the identity of the user.

The flexibility of Linux-PAM is that you, the system administrator, have the freedom to stipulate which authentication scheme is to be used. You have the freedom to set the scheme for any/all PAM-aware applications on your Linux system. That is, you can authenticate from anything as naive as simple trust (pam_permit) to something as paranoid as a combination of a retinal scan, a voice print and a one-time password!

To illustrate the flexibility you face, consider the following situation: a system administrator (parent) wishes to improve the mathematical ability of her users (children). She can configure their favorite ``Shoot 'em up game'' (PAM-aware of course) to authenticate them with a request for the product of a couple of random numbers less than 12. It is clear that if the game is any good they will soon learn their multiplication tables. As they mature, the authentication can be upgraded to include (long) division!

Linux-PAM deals with four separate types of (management) task. These are: authentication management; account management; session management; and password management. The association of the preferred management scheme with the behavior of an application is made with entries in the relevant Linux-PAM configuration file. The management functions are performed by modules specified in the configuration file. The syntax for this file is discussed in the section below.

Here is a figure that describes the overall organization of Linux-PAM:

  +----------------+
  | application: X |
  +----------------+       /  +----------+     +================+
  | authentication-[---->--\--] Linux-   |--<--| PAM config file|
  |       +        [----<--/--]   PAM    |     |================|
  |[conversation()][--+    \  |          |     | X auth .. a.so |
  +----------------+  |    /  +-n--n-----+     | X auth .. b.so |
  |                |  |       __|  |           |           _____/
  |  service user  |  A      |     |           |____,-----'
  |                |  |      V     A
  +----------------+  +------|-----|---------+ -----+------+
                         +---u-----u----+    |      |      |
                         |   auth....   |--[ a ]--[ b ]--[ c ]
                         +--------------+
                         |   acct....   |--[ b ]--[ d ]
                         +--------------+
                         |   password   |--[ b ]--[ c ]
                         +--------------+
                         |   session    |--[ e ]--[ c ]
                         +--------------+
      

By way of explanation, the left of the figure represents the application; application X. Such an application interfaces with the Linux-PAM library and knows none of the specifics of its configured authentication method. The Linux-PAM library (in the center) consults the contents of the PAM configuration file and loads the modules that are appropriate for application-X. These modules fall into one of four management groups (lower-center) and are stacked in the order they appear in the configuration file. These modules, when called by Linux-PAM, perform the various authentication tasks for the application. Textual information, required from/or offered to the user, can be exchanged through the use of the application-supplied conversation function.

If a program is going to use PAM, then it has to have PAM functions explicitly coded into the program. If you have access to the source code you can add the appropriate PAM functions. If you do not have access to the source code, and the binary does not have the PAM functions included, then it is not possible to use PAM.