System Administration Guide

Configuring PAM

The section below discusses some of the tasks that may be required to make the PAM framework fully functional. In particular, you should be aware of some of the security issues associated with the PAM configuration file.

Planning for PAM

When deciding how best to employ PAM in your environment, start by focusing on these issues:

How to Add a PAM Module

  1. Become superuser.

  2. Determine which control flags and other options should be used.

    Refer to "PAM Modules" information on the module.

  3. Copy the new module to /usr/lib/security.

  4. Set the permissions so that the module file is owned by root and permissions are 555.

  5. Edit the PAM configuration file, /etc/pam.conf, and add this module to the appropriate services.

Verification

It is very important to do some testing before the system is rebooted in case the configuration file is misconfigured. Run rlogin, su, and telnet before rebooting the system. If the service is a daemon spawned only once when the system is booted, it may be necessary to reboot the system before you can verify that the module has been added.

How to Prevent Unauthorized Access from Remote Systems with PAM

Remove the rlogin auth rhosts_auth.so.1 entry from the PAM configuration file. This prevents reading the ~/.rhosts files during an rlogin session and therefore prevents unauthenticated access to the local system from remote systems. All rlogin access requires a password, regardless of the presence or contents of any ~/.rhosts or /etc/hosts.equiv files.


Note -

To prevent other unauthenticated access to the ~/.rhosts files, remember to disable the rsh service. The best way to disable a service is to remove the service entry from /etc/inetd.conf. Changing the PAM configuration file does not prevent the service from being started.


How to Initiate PAM Error Reporting

  1. Edit the /etc/syslog.conf to add any of the following PAM error reporting entries:

    • auth.alert -- messages about conditions that should be fixed immediately

    • auth.crit -- critical messages

    • auth.err -- error messages

    • auth.info -- informational messages

    • auth.debug -- debugging messages

  2. Restart the syslog daemon or send a SIGHUP signal to it to activate the PAM error reporting.

Example--Initiating PAM Error Reporting

The example below displays all alert messages on the console. Critical messages are mailed to root. Informational and debug messages are added to the /var/log/pamlog file.


auth.alert	/dev/console
auth.crit	'root'
auth.info;auth.debug	/var/log/pamlog

Each line in the log contains a time stamp, the name of the system that generated the message, and the message itself. The pamlog file is capable of logging a large amount of information.