Copyright (C) 2007, Sun Microsystems, Inc. All Rights Reserved
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
pam_roles.so.1
The PAM items PAM_USER, PAM_AUSER, and PAM_RHOST are used to determine the outcome of this module. PAM_USER represents the new identity being verified. PAM_AUSER, if set, represents the user asserting a new identity. If PAM_AUSER is not set, the real user ID of the calling service implies that the user is asserting a new identity. Notice that root can never have roles.
This module is generally stacked above the pam_unix_account(7) module.
The following options are interpreted: allow_remote
Allows a remote service to specify the user to enter as a role.
Provides syslog(3C) debugging information at the LOG_DEBUG level.
If the type of the new user identity (PAM_USER) is "normal". Or, if the type of the new user identity is "role" and the user asserting the new identity (PAM_AUSER) has the new identity name in its list of roles.
No account is present for user.
If the type of the new user identity (PAM_USER) is "role" and the user asserting the new identity (PAM_AUSER) does not have the new identity name in its list of roles.
The following are sample entries from pam.conf(5). These entries demonstrate the use of the pam_roles.so.1 module:
cron account required pam_unix_account.so.1 # other account requisite pam_roles.so.1 other account required pam_unix_account.so.1 #
The cron service does not invoke pam_roles.so.1. Delayed jobs are independent of role assumption. All other services verify that roles cannot directly login. The "su" service (covered by the "other" service entry) verifies that if the new user is a role, the calling user is authorized for that role.
Example 2 Allowing Remote Roles
Remote roles should only be allowed from remote services that can be trusted to provide an accurate PAM_AUSER name. This trust is a function of the protocol (such as sshd-hostbased).
The following is a sample entry for a pam.conf(5) file. It demonstrates the use of pam_roles configuration for remote roles for the sshd-hostbased service.
sshd-hostbased account requisite pam_roles.so.1 allow_remote sshd-hostbased account required pam_unix_account.so.1
ATTRIBUTE TYPE ATTRIBUTE VALUE |
Interface Stability Evolving |
MT Level MT-Safe with exceptions |
This module should never be stacked alone. It never returns PAM_SUCCESS, as it never makes a positive decision.
The allow_remote option should only be specified for services that are trusted to correctly identify the remote user (that is, sshd-hostbased).
PAM_AUSER has replaced PAM_RUSER whose definition is limited to the rlogin/rsh untrusted remote user name. See pam_set_item(3PAM).