Previous | Table of Contents | Next |
When deciding how best to use PAM in your environment, start by focusing on the following issues:
Consider the following suggestions before changing the configuration file:
CAUTION! If the PAM configuration file is misconfigured or becomes corrupted, it is possible that even the superuser would not be able to log in. If the configuration file does become corrupted, you can boot in single-user mode and fix the problem because sulogin does not use PAM.
After you change the /etc/pam.conf file, review it carefully while still logged in as superuser. Test all of the commands that might have been affected by your changes. For example, if you added a new module to the telnet service, use the telnet command and verify that the changes you made behave as expected.
This section describes how to prevent unauthorized access from remote systems, initiate PAM error reporting, and add a PAM module.
To prevent unauthorized access from remote systems with PAM, remove the rlogin auth rhosts_auth.so.1 entry from the /etc/pam.conf configuration file. Without this entry, the ~/.rhosts files are not read during an rlogin session. Unauthenticated access to the local system from remote systems is prevented. 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 also disable the rsh service. The best way to disable a service is to comment out or remove the service entry from the /etc/inetd.conf file. Changing the PAM configuration file does not prevent the service from being started.
You can display five different levels of PAM error reporting by adding entries to the /etc/syslog file:
As with any other configuration entry in the syslog file, the entry consists of two tab-separated fields:
<selector> <action>
The <selector> field is one of the five levels of PAM error reporting. The <action> field indicates where to forward the message. Values for this field can have one of four forms:
Blank lines are ignored. Lines with a pound sign (#) as the first non-white character are treated as comments. Refer to the syslog.conf(4) manual page for more information.
To initiate PAM error reporting:
The following example 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. Be sure to monitor the size of the log and prune it periodically to delete old information.
You can add new PAM modules. The /usr/lib/security model contains a pam_sample.so.1 ELF executable file that you can use as a model for creating new modules.
CAUTION! It is very important to test any changes to the /etc/pam.conf configuration file before you reboot the system to detect any misconfiguration errors. Run rlogin, su, and telnet to test and verify expected access results before you reboot the system. However, if the service is a daemon spawned only once when the system is booted, you may need to reboot the system before you can verify that module.
To add a PAM module:
Previous | Table of Contents | Next |