System Administration Guide: Security Services

PAM Configuration File

The PAM configuration file, /etc/pam.conf, determines the authentication services to be used, and in what order they are used. This file can be edited to select authentication mechanisms for each system entry application.

PAM Configuration File Syntax

The PAM configuration file consists of entries with the following syntax:


service_name module_type control_flag module_path module_options

service_name

Is the name of the service (for example, ftp, login, telnet).

module_type

Is the module type for the service. For more information see PAM Module Types.

control_flag

Determines the continuation or failure behavior for the module. 

module_path

Specifies the path to the library object that implements the service. 

module_options

Specifies the options that are passed to the service modules. 

You can add comments to the pam.conf file by starting the line with a # (pound sign). Use white spaces or tabs to delimit the fields.


Note –

An entry in the PAM configuration file is ignored if one of the following conditions exist: the line has less than four fields, an invalid value is given for module_type or control_flag, or the named module does not exist.


Valid Service Names

The following table lists some valid service names, the module types that can be used with that service, and the daemon or command that is associated with the service name.

Not all module types are appropriate for each service. For example, the password module type is appropriate for only the passwd command. Also, since the passwd command is not concerned with authentication, there is no auth module type associated with it.

Table 3–2 Valid Service Names for the /etc/pam.conf File

Service Name 

Daemon or Command 

Applicable Module Types 

cron

/usr/sbin/cron

auth, account

dtlogin

/usr/dt/bin/dtlogin

auth, account, session

dtsession

/usr/dt/bin/dtsession

auth

ftp

/usr/sbin/in.ftpd

auth, account, session

init

/usr/sbin/init

session

login

/usr/bin/login

auth, account, session

passwd

/usr/bin/passwd

password

ppp

/usr/bin/ppp

auth, account, session

rexd

/usr/sbin/rpc.rexd

account, session

rlogin

/usr/sbin/in.rlogind

auth, account, session

rsh

/usr/sbin/in.rshd

auth, account, session

sac

/usr/lib/saf/sac

session

ssh

/usr/bin/ssh

auth, account, session

su

/usr/bin/su

auth, account

telnet

/usr/sbin/in.telnetd

auth, account, session

ttymon

/usr/lib/saf/ttymon

session

uucp

/usr/sbin/in.uucpd

auth, account, session

Control Flags

To determine the continuation or failure behavior from a module during the authentication process, you must select one of four control flags for each entry in the PAM configuration file, /etc/pam.conf. The control flags indicate how a successful attempt or a failed attempt through each module is handled. Even though these flags apply to all module types, the following explanation assumes that these flags are being used for authentication modules. The control flags are as follows:

More information about these control flags is provided in the following section, which describes the default /etc/pam.conf file.

Generic pam.conf File

The generic /etc/pam.conf file specifies the following actions:

  1. When the login command is run, authentication must succeed for the pam_authtok_get, pam_dhkeys, pam_auth_unix and the pam_dial_auth modules.

  2. For the rlogin command, authentication through the pam_authtok_get, pam_dhkeys, and pam_auth_unix modules must succeed, if authentication through pam_rhost_auth fails.

  3. The sufficient control flag indicates that for the rlogin command the successful authentication that is provided by the pam_rhost_auth module is sufficient, and the next entry will be ignored.

  4. Most of the other commands that require authentication require successful authentication through the pam_authtok_get, pam_dhkeys, and pam_auth_unix modules.

  5. For the rsh command, authentication through the pam_rhost_auth module is flagged as sufficient. No other authentication is required if authentication through the pam_rhost_auth module succeeds.

The OTHER service name allows a default to be set for any other commands that require authentication that are not included in the file. The OTHER option makes it easier to administer the file, since many commands that are using the same module can be covered by using only one entry. Also, the OTHER service name, when used as a “catch-all,” can ensure that each access is covered by one module. By convention, the OTHER entry is included at the bottom of the section for each module type.

Normally, the entry for the module_path is “root-relative.” If the file name you enter for module_path does not begin with a slash (/), the path /usr/lib/security/$ISA is prepended to the file name. A full path name must be used for modules that are located in other directories. The values for the module_options can be found in the man pages for the module. For example, the UNIX module is covered in the pam_unix(5) man page.


login   auth required           pam_authtok_get.so.1
login   auth required           pam_dhkeys.so.1
login   auth required           pam_unix_auth.so.1
login   auth required           pam_dial_auth.so.1

In this example, the login service specifies authentication through all four authentication modules. A login command fails if any of the modules return an error.