2 .\" Copyright (c) 2008, 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_KRB5 5 "Apr 8, 2008"
8 pam_krb5 \- authentication, account, session, and password management PAM
9 modules for Kerberos V5
13 /usr/lib/security/pam_krb5.so.1
19 The Kerberos V5 service module for \fBPAM\fR provides functionality for all
20 four \fBPAM\fR modules: authentication, account management, session management,
21 and password management. The service module is a shared object that can be
22 dynamically loaded to provide the necessary functionality upon demand. Its path
23 is specified in the \fBPAM\fR configuration file.
24 .SS "Kerberos Authentication Module"
27 The Kerberos V5 authentication component provides functions to verify the
28 identity of a user, \fBpam_sm_authenticate()\fR, and to manage the Kerberos
29 credentials cache, \fBpam_sm_setcred()\fR.
32 \fBpam_sm_authenticate()\fR authenticates a user principal through the Kerberos
33 authentication service. If the authentication request is successful, the
34 authentication service sends a ticket-granting ticket (\fBTGT\fR) back to the
35 service module, which then verifies that the \fBTGT\fR came from a valid Key
36 Distribution Center (\fBKDC\fR) by attempting to get a service ticket for the
37 local host service. For this to succeed, the local host's keytab file
38 (\fB/etc/krb5/krb5.keytab\fR) must contain the entry for the local host
39 service. For example, in the file \fBhost/\fIhostname.com\fR@\fIREALM\fR\fR,
40 \fIhostname.com\fR is the fully qualified local hostname and \fIREALM\fR is the
41 default realm of the local host as defined in \fB/etc/krb5/krb5.conf\fR. If the
42 host entry is not found in the keytab file, the authentication fails.
43 Administrators may optionally disable this "strict" verification by setting
44 "\fBverify_ap_req_nofail = false\fR" in \fB/etc/krb5/krb5.conf\fR. See
45 \fBkrb5.conf\fR(4) for more details on this option. This allows \fBTGT\fR
46 verification to succeed in the absence of a keytab host principal entry.
49 \fBpam_sm_authenticate\fR(3PAM) may be passed the following flag:
53 \fB\fBPAM_DISALLOW_NULL_AUTHTOK\fR\fR
57 This flag is ignored. The Kerberos authentication mechanism will not allow an
58 empty password string by default.
63 \fBpam_sm_setcred()\fR creates and modifies the user's credential cache. This
64 function initializes the user's credential cache, if it does not already exist,
65 and stores the initial credentials for later use by Kerberized network
66 applications. The following flags may be set in the flags field. They are best
67 described by their effect on the user's credential cache.
71 \fB\fBPAM_ESTABLISH_CRED\fR\fR
75 Stores the initial credentials in the user's credential cache so that the user
76 may access Kerberos network services. If a successful authentication pass was
77 made, the new credentials are stored in the credential cache, overwriting any
78 existing credentials that were previously stored. If an unsuccessful
79 authentication pass was made, PAM_CRED_UNAVAIL is returned.
85 \fB\fBPAM_DELETE_CRED\fR\fR
89 This flag has no effect on the credential cache and always returns
90 \fBPAM_SUCCESS\fR. The credential cache is not deleted because there is no
91 accurate method to determine if the credentials are needed by another process.
92 The credential cache may be deleted with the \fBkdestroy\fR(1) command.
98 \fB\fBPAM_REINITIALIZE_CRED\fR\fR
102 Deletes the user's existing credential cache, if it exists, and creates a new
103 credential cache. The new credentials are stored in the new cache and the
104 user's ticket lifetime and renewable life time values are reset.
110 \fB\fBPAM_REFRESH_CRED\fR\fR
114 Does not require a previous authentication pass, but if a successful one is
115 made, the new credentials are stored in the credential cache. If a previous
116 authentication pass was not made or was unsuccessful, an attempt to renew the
117 existing credentials is made. Note that this function fails if the user's
118 renewable ticket lifetime is expired.
123 The following options can be passed to the Kerberos V5 authentication module:
130 Provides \fBsyslog\fR(3C) debugging information at \fBLOG_DEBUG\fR level.
139 Turns off warning messages.
142 .SS "Kerberos V5 Account Management Module"
145 The Kerberos account management component provides a function to perform
146 account management, \fBpam_sm_acct_mgmt()\fR. This function checks to see if
147 the \fBpam_krb5\fR authentication module has noted that the user's password has
148 not expired. The following options may be passed in to the Kerberos V5 account
156 Provides \fBsyslog\fR(3C) debugging information at \fBLOG_DEBUG\fR level
165 Turns off warning messages. Also, does not query KDC for impending password
166 expiration information used to warn the user.
169 .SS "Kerberos V5 Session Management Module"
172 The Kerberos V5 session management component provides functions to initiate
173 \fBpam_sm_open_session()\fR and terminate \fBpam_sm_close_session()\fR Kerberos
174 sessions. For Kerberos V5, both \fBpam_sm_open_session\fR and
175 \fBpam_sm_close_session()\fR are null functions, returning \fBPAM_IGNORE\fR.
176 .SS "Kerberos V5 Password Management Module"
179 The Kerberos V5 password management component provides a function to change
180 passwords, \fBpam_sm_chauthtok()\fR, in the Key Distribution Center (\fBKDC\fR)
181 database. The following flags may be passed to \fBpam_sm_chauthtok\fR(3PAM):
185 \fB\fBPAM_CHANGE_EXPIRED_AUTHTOK\fR\fR
189 The password service should only update the user's Kerberos password if it is
190 expired. Otherwise, this function returns \fBPAM_IGNORE\fR. The default
191 behaviour is to always change the user's Kerberos password.
197 \fB\fBPAM_PRELIM_CHECK\fR\fR
201 This is a null function that always returns \fBPAM_IGNORE\fR.
207 \fB\fBPAM_UPDATE_AUTHTOK\fR\fR
211 This flag is necessary to change the user's Kerberos password. If this flag is
212 not set, \fBpam_krb5\fR returns \fBPAM_SYSTEM_ERR\fR.
217 The following option can be passed to the Kerberos V5 password module:
224 Provides \fBsyslog\fR(3C) debugging information at \fBLOG_DEBUG\fR level.
230 The following error codes are returned for \fBpam_sm_authenticate()\fR:
234 \fB\fBPAM_AUTH_ERR\fR\fR
237 Authentication failure
243 \fB\fBPAM_BUF_ERR\fR\fR
252 \fB\fBPAM_IGNORE\fR\fR
255 The user is "\fBroot\fR" and the root key exists in the default keytab.
261 \fB\fBPAM_SUCCESS\fR\fR
264 Successfully obtained Kerberos credentials .
270 \fB\fBPAM_SYSTEM_ERR\fR\fR
279 \fB\fBPAM_USER_UNKNOWN\fR\fR
282 An unknown Kerberos principal was requested.
287 The following error codes are returned for \fBpam_sm_setcred()\fR:
291 \fB\fBPAM_AUTH_ERR\fR\fR
294 Authentication failure.
300 \fB\fBPAM_BUF_ERR\fR\fR
309 \fB\fBPAM_IGNORE\fR\fR
312 The user is "\fBroot\fR" and the root key exists in the default keytab.
318 \fB\fBPAM_SYSTEM_ERR\fR\fR
327 \fB\fBPAM_SUCCESS\fR\fR
330 Successfully modified the Kerberos credential cache.
335 The following error codes are returned for \fBpam_sm_acct_mgmt()\fR:
339 \fB\fBPAM_AUTH_ERR\fR\fR
342 Authentication failure.
348 \fB\fBPAM_IGNORE\fR\fR
351 Kerberos service module \fBpam_sm_authenticate()\fR was never called, or the
352 user is "\fBroot\fR" and the root key exists in the default keytab.
358 \fB\fBPAM_NEW_AUTHTOK_REQD\fR\fR
361 Obtain new authentication token from the user.
367 \fB\fBPAM_SERVICE_ERR\fR\fR
370 Error in underlying service module.
376 \fB\fBPAM_SUCCESS\fR\fR
379 Kerberos principal account is valid.
385 \fB\fBPAM_SYSTEM_ERR\fR\fR
394 \fB\fBPAM_USER_UNKNOWN\fR\fR
397 An unknown Kerberos principal was requested.
402 The following error code is returned for \fBpam_sm_open_session()\fR and
403 \fBpam_sm_close_session()\fR:
407 \fB\fBPAM_IGNORE\fR\fR
410 These two functions are null functions in \fBpam_krb5\fR:
415 The following error codes are returned for \fBpam_sm_chauthtok()\fR:
419 \fB\fBPAM_AUTH_ERR\fR\fR
422 Authentication failure.
428 \fB\fBPAM_IGNORE\fR\fR
431 The user has not been authenticated by Kerberos service module
432 \fBpam_sm_authenticate()\fR, or the user is "\fBroot\fR" and the root key
433 exists in the default keytab.
439 \fB\fBPAM_NEW_AUTHTOK_REQD\fR\fR
442 User's Kerberos password has expired.
448 \fB\fBPAM_SERVICE_ERR\fR\fR
451 Error in module. At least one input parameter is missing.
457 \fB\fBPAM_SYSTEM_ERR\fR\fR
466 \fB\fBPAM_USER_UNKNOWN\fR\fR
469 An unknown Kerberos principal was requested.
475 \fB\fBPAM_SUCCESS\fR\fR
478 Successfully changed the user's Kerberos password.
483 \fBExample 1 \fRAuthenticate Users Through Kerberos as First Choice
486 The following is an excerpt of a sample \fBpam.conf\fR configuration file that
487 authenticates users through the Kerberos authentication service and
488 authenticates through the Unix login only if the Kerberos authentication fails.
489 This arrangement is helpful when a majority of the users are networked by means
490 of Kerberos and when there are only a few non-Kerberos type user accounts, such
491 as root. The service illustrated below is for \fBdtlogin\fR.
496 dtlogin auth requisite pam_smartcard.so.1
497 dtlogin auth requisite pam_authtok_get.so.1
498 dtlogin auth required pam_dhkeys.so.1
499 dtlogin auth required pam_unix_cred.so.1
500 dtlogin auth sufficient pam_krb5.so.1
501 dtlogin auth required pam_unix_auth.so.1
507 Note that these changes should not be made to the existing \fBkrlogin\fR,
508 \fBkrsh\fR, and \fBktelnet\fR service entries. Those services require Kerberos
509 authentication, so using a seemingly sufficient control flag would not provide
510 the necessary functionality for privacy and integrity. There should be no need
511 to change those entries.
515 The following entries check for password expiration when dealing with Kerberos
516 and Unix password aging policies:
521 other account requisite pam_roles.so.1
522 other account required pam_unix_account.so.1
523 other account required pam_krb5.so.1
529 The following entries would change the Kerberos password of the user and
530 continue to change the Unix login password only if the Kerberos password change
536 other password required pam_dhkeys.so.1
537 other password requisite pam_authtok_get.so.1
538 other password requisite pam_authtok_check.so.1
539 other password sufficient pam_krb5.so.1
540 other password required pam_authtok_store.so.1
546 When changing Kerberos based user's password, use \fBkpasswd\fR(1). When
547 changing a non-Kerberos user's password, it is recommended that the repository
548 is specified (\fB-r\fR) with the \fBpasswd\fR(1) command.
551 \fBExample 2 \fRAuthenticate Users Through Kerberos Only
554 The following example allows authentication only to users that have
555 Kerberos-based accounts.
560 dtlogin auth requisite pam_smartcard.so.1
561 dtlogin auth requisite pam_authtok_get.so.1
562 dtlogin auth required pam_dhkeys.so.1
563 dtlogin auth required pam_unix_cred.so.1
564 dtlogin auth binding pam_krb5.so.1
565 dtlogin auth required pam_unix_auth.so.1
571 Typically, you would have another service specified in the \fBpam.conf\fR file
572 that would allow local users, such as database, web server, system
573 administrator accounts, to log in to the host machine. For example, the service
574 name "login" could be used for these users. Note that these users should not
579 The rest of the module types look similar to that shown in the previous
585 other account requisite pam_roles.so.1
586 other account required pam_unix_account.so.1
587 other account required pam_krb5.so.1
593 With binding specified in the following, it is important that non-Kerberos
594 users specify the repository in which they reside using the \fB-r\fR option
595 with the \fBpasswd\fR(1) command. This configuration is also based on the
602 Kerberos users maintain only their Kerberos passwords;
608 changing their Unix password is not necessary, given that they are
609 authenticated only through their Kerberos passwords when logging in.
614 other password required pam_dhkeys.so.1
615 other password requisite pam_authtok_get.so.1
616 other password requisite pam_authtok_check.so.1
617 other password binding pam_krb5.so.1
618 other password required pam_authtok_store.so.1
623 \fBExample 3 \fRAuthenticate Through Kerberos Optionally
626 This configuration is helpful when the majority of users are non-Kerberos users
627 and would like to authenticate through Kerberos if they happened to exist in
628 the Kerberos database. The effect of this is similar to users voluntarily
629 executing \fBkinit\fR(1) after they have successfully logged in:
634 dtlogin auth requisite pam_smartcard.so.1
635 dtlogin auth requisite pam_authtok_get.so.1
636 dtlogin auth required pam_dhkeys.so.1
637 dtlogin auth required pam_unix_cred.so.1
638 dtlogin auth required pam_unix_auth.so.1
639 dtlogin auth optional pam_krb5.so.1
645 The rest of the configuration is as follows:
650 other account requisite pam_roles.so.1
651 other account required pam_unix_account.so.1
652 other account required pam_krb5.so.1
654 other password required pam_dhkeys.so.1
655 other password requisite pam_authtok_get.so.1
656 other password requisite pam_authtok_check.so.1
657 other password required pam_authtok_store.so.1
658 other password optional pam_krb5.so.1
664 Non-Kerberos users should specify their respective repositories by using the
665 \fB-r\fR option when changing their password with the \fBpasswd\fR(1) command.
670 See \fBattributes\fR(5) for descriptions of the following attributes:
678 ATTRIBUTE TYPE ATTRIBUTE VALUE
680 Interface Stability Evolving
686 \fBkdestroy\fR(1), \fBkinit\fR(1), \fBkpasswd\fR(1), \fBpasswd\fR(1),
687 \fBktkt_warnd\fR(1M), \fBlibpam\fR(3LIB), \fBpam\fR(3PAM), \fBpam_sm\fR(3PAM),
688 \fBpam_sm_acct_mgmt\fR(3PAM), \fBpam_sm_authenticate\fR(3PAM),
689 \fBpam_sm_chauthtok\fR(3PAM), \fBpam_sm_close_session\fR(3PAM),
690 \fBpam_sm_open_session\fR(3PAM), \fBpam_sm_setcred\fR(3PAM), \fBsyslog\fR(3C),
691 \fBpam.conf\fR(4), \fBattributes\fR(5), \fBkerberos\fR(5), \fBkrb5envvar\fR(5)
695 The interfaces in \fBlibpam\fR(3LIB) are MT-Safe only if each thread within the
696 multi-threaded application uses its own \fBPAM\fR handle.
699 On successful acquisition of initial credentials (ticket-granting ticket),
700 \fBktkt_warnd\fR(1M) will be notified, to alert the user when the initial
701 credentials are about to expire.