3 .\" Generator: DocBook XSL Stylesheets v1.70.1 <http://docbook.sf.net/>
5 .\" Manual: Linux\-PAM Manual
6 .\" Source: Linux\-PAM Manual
8 .TH "PAM" "3" "06/19/2006" "Linux\-PAM Manual" "Linux\-PAM Manual"
9 .\" disable hyphenation
11 .\" disable justification (adjust text to left margin only)
14 pam \- Pluggable Authentication Modules Library
19 #include <security/pam_appl.h>
25 #include <security/pam_modules.h>
31 #include <security/pam_ext.h>
38 is a system of libraries that handle the authentication tasks of applications (services) on the system. The library provides a stable general interface (Application Programming Interface \- API) that privilege granting programs (such as
41 \fBsu\fR(1)) defer to to perform standard authentication tasks.
42 .SS "Initialization and Cleanup"
46 function creates the PAM context and initiates the PAM transaction. It is the first of the PAM functions that needs to be called by an application. The transaction state is contained entirely within the structure identified by this handle, so it is possible to have multiple transactions in parallel. But it is not possible to use the same handle for different transactions, a new one is needed for every new context.
50 function terminates the PAM transaction and is the last function an application should call in the PAM contenxt. Upon return the handle pamh is no longer valid and all memory associated with it will be invalid. It can be called at any time to terminate a PAM transaction.
51 .\" end of SS subsection "Initialization and Cleanup"
55 \fBpam_authenticate\fR(3)
56 function is used to authenticate the user. The user is required to provide an authentication token depending upon the authentication service, usually this is a password, but could also be a finger print.
60 function manages the userscredentials.
61 .\" end of SS subsection "Authentication"
62 .SS "Account Management"
65 \fBpam_acct_mgmt\fR(3)
66 function is used to determine if the users account is valid. It checks for authentication token and account expiration and verifies access restrictions. It is typically called after the user has been authenticated.
67 .\" end of SS subsection "Account Management"
68 .SS "Password Management"
71 \fBpam_chauthtok\fR(3)
72 function is used to change the authentication token for a given user on request or because the token has expired.
73 .\" end of SS subsection "Password Management"
74 .SS "Session Management"
77 \fBpam_open_session\fR(3)
78 function sets up a user session for a previously successful authenticated user. The session should later be terminated with a call to
79 \fBpam_close_session\fR(3).
80 .\" end of SS subsection "Session Management"
83 The PAM library uses an application\-defined callback to allow a direct communication between a loaded module and the application. This callback is specified by the
87 at the start of the transaction. See
90 .\" end of SS subsection "Conversation"
97 functions allows applications and PAM service modules to set and retrieve PAM informations.
100 \fBpam_set_data\fR(3)
102 \fBpam_get_data\fR(3)
103 functions allows PAM service modules to set and retrieve free\-form data from one invocation to another.
104 .\" end of SS subsection "Data Objects"
105 .SS "Environment and Error Management"
111 \fBpam_getenvlist\fR(3)
112 functions are for maintaining a set of private environment variables.
115 \fBpam_strerror\fR(3)
116 function returns a pointer to a string describing the given PAM error code.
117 .\" end of SS subsection "Environment and Error Management"
120 The following return codes are known by PAM:
123 Critical error, immediate abort.
126 User account has expired.
129 Authentication service cannot retrieve authentication info.
131 PAM_AUTHTOK_DISABLE_AGING
132 Authentication token aging disabled.
135 Authentication token manipulation error.
138 Authentication token expired.
140 PAM_AUTHTOK_LOCK_BUSY
141 Authentication token lock busy.
143 PAM_AUTHTOK_RECOVERY_ERR
144 Authentication information cannot be recovered.
147 Authentication failure.
153 Conversation failure.
156 Failure setting user credentials.
159 User credentials expired.
161 PAM_CRED_INSUFFICIENT
162 Insufficient credentials to access authentication data.
165 Authentication service cannot retrieve user credentials.
168 The return value should be ignored by PAM dispatch.
171 Have exhausted maximum number of retries for service.
177 Authentication token is no longer valid; new one required.
180 No module specific data is present.
183 Failed to load module.
189 Error in service module.
192 Cannot make/remove an entry for the specified session.
204 Failed preliminary check by password service.
207 User not known to the underlying authentication module.
211 \fBpam_acct_mgmt\fR(3),
212 \fBpam_authenticate\fR(3),
213 \fBpam_chauthtok\fR(3),
214 \fBpam_close_session\fR(3),
217 \fBpam_get_data\fR(3),
219 \fBpam_getenvlist\fR(3),
220 \fBpam_get_item\fR(3),
221 \fBpam_get_user\fR(3),
222 \fBpam_open_session\fR(3),
224 \fBpam_set_data\fR(3),
225 \fBpam_set_item\fR(3),
226 \fBpam_setcred\fR(3),
228 \fBpam_strerror\fR(3)