PAM Under AIX Information Page


PAM vs LAM

AIX has its own authentication framework, which is called the Loadable Authentication Module (LAM) system. So when using PAM under AIX, there are actually two different authentication systems in use. Both provide similar functionality, and both are modular, but they're designed very differently in terms of application API, module API, and config file format.

If you have an application that uses the PAM application API, it will use the PAM modules configured in /etc/pam.conf; if you have an application that uses the LAM application API, it will use the LAM modules configured in /usr/lib/security/methods.cfg.

The LAM module API for AIX 5.2 is documented here:

http://publib16.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/kernextc/sec_load_mod.htm
The LAM module API was not documented in AIX 4.3, but my guess is that it was probably the same.

Back


AIX 4.3

AIX 4.3 does not include PAM. However, I've written a patch for building Linux-PAM under AIX.

The patch includes a PAM module called pam_aix that "converts" PAM calls into the corresponding LAM calls, so that PAM-aware applications can make use of LAM even though they don't have any knowledge of the LAM application API. Because LAM provides AIX's default authentication mechanism, pam_aix can be used as the default module in /etc/pam.conf, much as pam_unix is on other platforms. For example:

other   auth     required       /usr/local/lib/security/pam_aix.so
other   account  required       /usr/local/lib/security/pam_aix.so
other   session  required       /usr/local/lib/security/pam_aix.so
other   password required       /usr/local/lib/security/pam_aix.so

Back


AIX 5.1

The stock AIX 5.1 CDs do not include PAM. Starting with ML01, the PAM library is included. However, no PAM modules are supplied and there is no default /etc/pam.conf file.

To address this problem, IBM has backported their implementation of the pam_aix module from AIX 5.2 and made it available for AIX 5.1:

https://techsupport.services.ibm.com/server/nav/pam
Note that IBM's implementation of pam_aix was done completely independently of the one I wrote for AIX 4.3. It does not support the same options, but it works the same otherwise.

Back


AIX 5.2

AIX 5.2 has full support for PAM. It ships with the PAM library, the pam_aix module, and a default /etc/pam.conf file.

Similarly to the way that pam_aix "converts" from PAM to LAM, AIX 5.2 also includes a LAM module that "converts" from LAM to PAM. The IBM documentation refers to this as the "PAM module", which is extremely confusing; to avoid this, I will refer to this module using its full path, /usr/lib/security/PAM.

As mentioned above, pam_aix is a PAM module that you configure in /etc/pam.conf, and it allows PAM-aware applications to make use of LAM even though they don't have any knowledge of the LAM application API. Conversely, /usr/lib/security/PAM is a LAM module that you configure in /usr/lib/security/methods.cfg, and it allows LAM-aware applications to make use of PAM even though they don't have any knowledge of the PAM application API.

The /usr/lib/security/PAM LAM module is documented here:

http://publib16.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixbman/security/pam_overview.htm
Unfortunately, /usr/lib/security/PAM is not a very elegent solution, because it requires major modifications on the part of any PAM module that you want to use with it. Because the LAM API does not support the notion of a conversation function, all PAM modules must be modified to use the pam_get_item() and pam_set_item() calls to communicate with the application.

(If you're familiar with the PAM and LAM APIs, it's pretty obvious why this is a problem. PAM uses an out-of-band mechanism (the conversation function) to communicate with the application, while the LAM API uses iterative calls to the authenticate() function. Even if /usr/lib/security/PAM supplied its own conversation function for communicating with PAM, there's no reasonable way for the conversation function to jump back into the initial stack frame of the original authenticate() call without losing state between each iteration.)

Unfortunately, because the native AIX binaries (e.g., /bin/login and /bin/su) still call LAM directly, there is no reasonable way for them to use existing off-the-shelf PAM modules. The only alternative is to try to replace the native AIX binaries with open source alternatives that are PAM-aware, but that's a fairly complicated proposition, and I don't know of anyone who's actually tried to do that.

Back


AIX 5.3

AIX 5.3 finally has native PAM support in all of the native AIX binaries (e.g., /bin/login, /bin/su, etc). By default, these binaries will still use the historic AIX authentication mechanism, but they can be configured to use PAM instead by changing a setting in /etc/security/login.cfg. For details, see:
http://publib.boulder.ibm.com/infocenter/pseries/index.jsp?topic=/com.ibm.aix.doc/aixbman/security/pam_overview.htm
Back


Mark D. Roth <roth@feep.net>