1.\" $NetBSD: pam.3,v 1.6 2014/06/10 11:36:41 wiz Exp $ 2.\" 3.\" Generated by gendoc.pl 4.Dd September 7, 2013 5.Dt PAM 3 6.Os 7.Sh NAME 8.Nm openpam 9.Nd Pluggable Authentication Modules Library 10.Sh LIBRARY 11.Lb libpam 12.Sh SYNOPSIS 13.In security/pam_appl.h 14.\" 15.\" Id: pam.man 648 2013-03-05 17:54:27Z des 16.\" 17.Sh DESCRIPTION 18The Pluggable Authentication Modules (PAM) library abstracts a number 19of common authentication-related operations and provides a framework 20for dynamically loaded modules that implement these operations in 21various ways. 22.Ss Terminology 23In PAM parlance, the application that uses PAM to authenticate a user 24is the server, and is identified for configuration purposes by a 25service name, which is often (but not necessarily) the program name. 26.Pp 27The user requesting authentication is called the applicant, while the 28user (usually, root) charged with verifying his identity and granting 29him the requested credentials is called the arbitrator. 30.Pp 31The sequence of operations the server goes through to authenticate a 32user and perform whatever task he requested is a PAM transaction; the 33context within which the server performs the requested task is called 34a session. 35.Pp 36The functionality embodied by PAM is divided into six primitives 37grouped into four facilities: authentication, account management, 38session management and password management. 39.Ss Conversation 40The PAM library expects the application to provide a conversation 41callback which it can use to communicate with the user. 42Some modules may use specialized conversation functions to communicate 43with special hardware such as cryptographic dongles or biometric 44devices. 45See 46.Xr pam_conv 3 47for details. 48.Ss Initialization and Cleanup 49The 50.Fn pam_start 51function initializes the PAM library and returns a handle which must 52be provided in all subsequent function calls. 53The transaction state is contained entirely within the structure 54identified by this handle, so it is possible to conduct multiple 55transactions in parallel. 56.Pp 57The 58.Fn pam_end 59function releases all resources associated with the specified context, 60and can be called at any time to terminate a PAM transaction. 61.Ss Storage 62The 63.Fn pam_set_item 64and 65.Fn pam_get_item 66functions set and retrieve a number of predefined items, including the 67service name, the names of the requesting and target users, the 68conversation function, and prompts. 69.Pp 70The 71.Fn pam_set_data 72and 73.Fn pam_get_data 74functions manage named chunks of free-form data, generally used by 75modules to store state from one invocation to another. 76.Ss Authentication 77There are two authentication primitives: 78.Fn pam_authenticate 79and 80.Fn pam_setcred . 81The former authenticates the user, while the latter manages his 82credentials. 83.Ss Account Management 84The 85.Fn pam_acct_mgmt 86function enforces policies such as password expiry, account expiry, 87time-of-day restrictions, and so forth. 88.Ss Session Management 89The 90.Fn pam_open_session 91and 92.Fn pam_close_session 93functions handle session setup and teardown. 94.Ss Password Management 95The 96.Fn pam_chauthtok 97function allows the server to change the user's password, either at 98the user's request or because the password has expired. 99.Ss Miscellaneous 100The 101.Fn pam_putenv , 102.Fn pam_getenv 103and 104.Fn pam_getenvlist 105functions manage a private environment list in which modules can set 106environment variables they want the server to export during the 107session. 108.Pp 109The 110.Fn pam_strerror 111function returns a pointer to a string describing the specified PAM 112error code. 113.Sh RETURN VALUES 114The following return codes are defined by 115.In security/pam_constants.h : 116.Bl -tag -width 18n 117.It Bq Er PAM_ABORT 118General failure. 119.It Bq Er PAM_ACCT_EXPIRED 120User account has expired. 121.It Bq Er PAM_AUTHINFO_UNAVAIL 122Authentication information is unavailable. 123.It Bq Er PAM_AUTHTOK_DISABLE_AGING 124Authentication token aging disabled. 125.It Bq Er PAM_AUTHTOK_ERR 126Authentication token failure. 127.It Bq Er PAM_AUTHTOK_EXPIRED 128Password has expired. 129.It Bq Er PAM_AUTHTOK_LOCK_BUSY 130Authentication token lock busy. 131.It Bq Er PAM_AUTHTOK_RECOVERY_ERR 132Failed to recover old authentication token. 133.It Bq Er PAM_AUTH_ERR 134Authentication error. 135.It Bq Er PAM_BUF_ERR 136Memory buffer error. 137.It Bq Er PAM_CONV_ERR 138Conversation failure. 139.It Bq Er PAM_CRED_ERR 140Failed to set user credentials. 141.It Bq Er PAM_CRED_EXPIRED 142User credentials have expired. 143.It Bq Er PAM_CRED_INSUFFICIENT 144Insufficient credentials. 145.It Bq Er PAM_CRED_UNAVAIL 146Failed to retrieve user credentials. 147.It Bq Er PAM_DOMAIN_UNKNOWN 148Unknown authentication domain. 149.It Bq Er PAM_IGNORE 150Ignore this module. 151.It Bq Er PAM_MAXTRIES 152Maximum number of tries exceeded. 153.It Bq Er PAM_MODULE_UNKNOWN 154Unknown module type. 155.It Bq Er PAM_NEW_AUTHTOK_REQD 156New authentication token required. 157.It Bq Er PAM_NO_MODULE_DATA 158Module data not found. 159.It Bq Er PAM_OPEN_ERR 160Failed to load module. 161.It Bq Er PAM_PERM_DENIED 162Permission denied. 163.It Bq Er PAM_SERVICE_ERR 164Error in service module. 165.It Bq Er PAM_SESSION_ERR 166Session failure. 167.It Bq Er PAM_SUCCESS 168Success. 169.It Bq Er PAM_SYMBOL_ERR 170Invalid symbol. 171.It Bq Er PAM_SYSTEM_ERR 172System error. 173.It Bq Er PAM_TRY_AGAIN 174Try again. 175.It Bq Er PAM_USER_UNKNOWN 176Unknown user. 177.El 178.Sh SEE ALSO 179.Xr openpam 3 , 180.Xr pam_conv 3 181.Sh STANDARDS 182.Rs 183.%T "X/Open Single Sign-On Service (XSSO) - Pluggable Authentication Modules" 184.%D "June 1997" 185.Re 186.Sh AUTHORS 187The OpenPAM library and this manual page were developed for the 188.Fx 189Project by ThinkSec AS and Network Associates Laboratories, the 190Security Research Division of Network Associates, Inc.\& under 191DARPA/SPAWAR contract N66001-01-C-8035 192.Pq Dq CBOSS , 193as part of the DARPA CHATS research program. 194.Pp 195The OpenPAM library is maintained by 196.An Dag-Erling Sm\(/orgrav Aq Mt des@des.no . 197