2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved
3 .\" 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.
4 .\" 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.
5 .\" 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]
6 .TH PAM_SAMPLE 5 "Apr 4, 2007"
8 pam_sample \- a sample PAM module
12 \fB/usr/lib/security/pam_sample.so.1\fR
18 The SAMPLE service module for \fBPAM\fR is divided into four components:
19 authentication, account management, password management, and session
20 management. The sample module is a shared object that is dynamically loaded to
21 provide the necessary functionality.
22 .SH SAMPLE AUTHENTICATION COMPONENT
25 The SAMPLE authentication module provides functions to test the \fBPAM\fR
26 framework functionality using the \fBpam_sm_authenticate\fR(3PAM) call. The
27 SAMPLE module implementation of the \fBpam_sm_authenticate\fR(3PAM) function
28 compares the user entered password with the password set in the
29 \fBpam.conf\fR(4) file, or the string "test" if a default test password has not
30 been set. The following options can be passed in to the SAMPLE Authentication
38 Syslog debugging information at the \fBLOG_DEBUG\fR level.
44 \fB\fBpass=newone\fR \fR
47 Sets the password to be "newone".
53 \fB\fBfirst_pass_good\fR \fR
56 The first password is always good when used with the use_first_pass or
57 try_first_pass option.
63 \fB\fBfirst_pass_bad\fR \fR
66 The first password is always bad when used with the use_first_pass or
67 try_first_pass option.
73 \fB\fBalways_fail\fR \fR
76 Always returns \fBPAM_AUTH_ERR.\fR
82 \fB\fBalways_succeed\fR \fR
85 Always returns \fBPAM_SUCCESS.\fR
91 \fB\fBalways_ignore\fR \fR
94 Always returns \fBPAM_IGNORE.\fR
100 \fB\fBuse_first_pass\fR \fR
103 Use the user's initial password (entered when the user is authenticated to the
104 first authentication module in the stack) to authenticate with the SAMPLE
105 module. If the passwords do not match, or if this is the first authentication
106 module in the stack, quit and do not prompt the user for a password. It is
107 recommended that this option only be used if the SAMPLE authentication module
108 is designated as \fIoptional\fR in the \fBpam.conf\fR configuration file.
114 \fB\fBtry_first_pass\fR \fR
117 Use the user's initial password (entered when the user is authenticated to the
118 first authentication module in the stack) to authenticate with the SAMPLE
119 module. If the passwords do not match, or if this is the first authentication
120 module in the stack, prompt the user for a password.
122 The SAMPLE module \fBpam_sm_setcred\fR(3PAM) function always returns
126 .SH SAMPLE ACCOUNT MANAGEMENT COMPONENT
129 The SAMPLE Account Management Component implements a simple access control
130 scheme that limits machine access to a list of authorized users. The list of
131 authorized users is supplied as option arguments to the entry for the SAMPLE
132 account management \fBPAM\fR module in the \fBpam.conf\fR file. Note that the
133 module always permits access to the root super user.
136 The option field syntax to limit access is shown below: allow=
137 \fIname[,name]\fR allow= \fIname\fR \fI[allow=name]\fR
140 The example \fBpam.conf\fR show below permits only larry to \fBlogin\fR
141 directly. \fBrlogin\fR is allowed only for don and larry. Once a user is logged
142 in, the user can use \fBsu\fR if the user are sam or eric.
149 login account require pam_sample.so.1 allow=larry
150 dtlogin account require pam_sample.so.1 allow=larry
151 rlogin account require pam_sample.so.1 allow=don allow=larry
152 su account require pam_sample.so.1 allow=sam,eric
157 The debug and nowarn options are also supported.
158 .SH SAMPLE PASSWORD MANAGEMENT COMPONENT
161 The SAMPLE Password Management Component function (
162 \fBpam_sm_chauthtok\fR(3PAM)), always returns \fBPAM_SUCCESS.\fR
163 .SH SAMPLE SESSION MANAGEMENT COMPONENT
166 The SAMPLE Session Management Component functions (
167 \fBpam_sm_open_session\fR(3PAM), \fBpam_sm_close_session\fR(3PAM)) always
168 return \fBPAM_SUCCESS.\fR
172 See \fBattributes\fR(5) for description of the following attributes:
180 ATTRIBUTE TYPE ATTRIBUTE VALUE
182 MT Level MT-Safe with exceptions
188 \fBpam\fR(3PAM), \fBpam_sm_authenticate\fR(3PAM), \fBpam_sm_chauthtok\fR(3PAM),
189 \fBpam_sm_close_session\fR(3PAM), \fBpam_sm_open_session\fR(3PAM),
190 \fBpam_sm_setcred\fR(3PAM), \fBlibpam\fR(3LIB), \fBpam.conf\fR(4),
195 This module should never be used outside of a closed debug environment. The
196 examples of the \fBuse_first_pass\fR and \fBtry_first_pass\fR options are
197 obsolete for all other Solaris delivered PAM service modules
201 The interfaces in \fBlibpam()\fR are MT-Safe only if each thread within the
202 multi-threaded application uses its own \fBPAM\fR handle.