1 .\" $NetBSD: pam_krb5.8,v 1.10 2007/12/01 18:33:11 wiz Exp $
2 .\" $FreeBSD: src/lib/libpam/modules/pam_krb5/pam_krb5.8,v 1.6 2001/11/24 23:41:32 dd Exp $
4 .\" Copyright (c) Frank Cusack, 1999-2001. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notices, and the entire permission notice in its entirety,
11 .\" including the disclaimer of warranties.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
15 .\" 3. The name of the author may not be used to endorse or promote
16 .\" products derived from this software without specific prior
17 .\" written permission.
19 .\" ALTERNATIVELY, this product may be distributed under the terms of
20 .\" the GNU Public License, in which case the provisions of the GPL are
21 .\" required INSTEAD OF the above restrictions. (This clause is
22 .\" necessary due to a potential bad interaction between the GPL and
23 .\" the restrictions contained in a BSD-style copyright.)
25 .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
26 .\" WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
27 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28 .\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
29 .\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30 .\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31 .\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
33 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
35 .\" OF THE POSSIBILITY OF SUCH DAMAGE.
42 .Nd Kerberos 5 PAM module
50 The Kerberos 5 service module for PAM
51 provides functionality for three PAM categories:
54 and password management.
55 It also provides null functions for session management.
56 .Ss Kerberos 5 Authentication Module
57 The Kerberos 5 authentication component
58 provides functions to verify the identity of a user
59 .Pq Fn pam_sm_authenticate
60 and to set user specific credentials
61 .Pq Fn pam_sm_setcred .
62 .Fn pam_sm_authenticate
63 converts the supplied username into a Kerberos principal,
64 by appending the default local realm name.
65 It also supports usernames with explicit realm names.
66 If a realm name is supplied, then upon a successful return, it
67 changes the username by mapping the principal name into a local username
69 .Fn krb5_aname_to_localname ) .
70 This typically just means
71 the realm name is stripped.
73 It prompts the user for a password and obtains a new Kerberos TGT for
75 The TGT is verified by obtaining a service
76 ticket for the local host.
78 When prompting for the current password, the authentication
79 module will use the prompt
80 .Dq Li "Password for \*[Lt]principal\*[Gt]:" .
84 function stores the newly acquired credentials in a credentials cache,
85 and sets the environment variable
88 The credentials cache should be destroyed by the user at logout with
91 The following options may be passed to the authentication module:
92 .Bl -tag -width ".Cm use_first_pass"
95 debugging information at
99 suppress warning messages to the user.
100 These messages include
101 reasons why the user's
102 authentication attempt was declined.
103 .It Cm use_first_pass
104 If the authentication module is not the first in the stack,
105 and a previous module obtained the user's password, that password is
106 used to authenticate the user.
107 If this fails, the authentication
108 module returns failure without prompting the user for a password.
109 This option has no effect if the authentication module is
110 the first in the stack, or if no previous modules obtained the
112 .It Cm try_first_pass
113 This option is similar to the
115 option, except that if the previously obtained password fails, the
116 user is prompted for another password.
117 .It Cm renewable Ns = Ns Ar timeperiod
118 Obtain renewable Kerberos credentials for the user.
119 The renewable time can be specified, or it defaults to one month.
120 Since spaces are not allowed in the pam configuration time, underscores
121 are used to form parseable times (e.g., 1_month).
123 Obtain forwardable Kerberos credentials for the user.
125 Do not save the obtained credentials in a credentials cache.
127 useful option if the authentication module is used for services such
128 as ftp or pop, where the user would not be able to destroy them.
130 is not a recommendation to use the module for those services.]
131 .It Cm ccache Ns = Ns Ar name
134 as the credentials cache.
137 .Ar type : Ns Ar residual .
140 to designate the decimal UID of the user;
143 to designate the current process ID; can be used in
146 .Ss Kerberos 5 Account Management Module
147 The Kerberos 5 account management component
148 provides a function to perform account management,
149 .Fn pam_sm_acct_mgmt .
150 The function verifies that the authenticated principal is allowed
151 to login to the local user account by calling
153 (which checks the user's
156 .Ss Kerberos 5 Password Management Module
157 The Kerberos 5 password management component
158 provides a function to change passwords
159 .Pq Fn pam_sm_chauthtok .
160 The username supplied (the
163 command, or the username given as an argument) is mapped into
164 a Kerberos principal name, using the same technique as in
165 the authentication module.
166 Note that if a realm name was
167 explicitly supplied during authentication, but not during
168 a password change, the mapping
169 done by the password management module may not result in the
170 same principal as was used for authentication.
175 password, the password management module will
176 allow any user to change any principal's password (if the user knows
177 the principal's old password, of course).
181 is always prompted for the principal's old password.
183 The password management module uses the same heuristics as
185 to determine how to contact the Kerberos password server.
187 The following options may be passed to the password management
189 .Bl -tag -width ".Cm use_first_pass"
192 debugging information at
195 .It Cm use_first_pass
196 If the password management module is not the first in the stack,
197 and a previous module obtained the user's old password, that password is
198 used to authenticate the user.
199 If this fails, the password
201 module returns failure without prompting the user for the old password.
202 If successful, the new password entered to the previous module is also
203 used as the new Kerberos password.
204 If the new password fails,
205 the password management module returns failure without
206 prompting the user for a new password.
207 .It Cm try_first_pass
208 This option is similar to the
210 option, except that if the previously obtained old or new passwords fail,
211 the user is prompted for them.
213 .Ss Kerberos 5 Session Management Module
214 The Kerberos 5 session management component
215 provides functions to initiate
216 .Pq Fn pam_sm_open_session
218 .Pq Fn pam_sm_close_session
220 Since session management is not defined under Kerberos 5,
221 both of these functions simply return success.
223 only because of the naming conventions for PAM modules.
225 .Bl -tag -width "KRB5CCNAME"
227 Location of the credentials cache.
230 .Bl -tag -width ".Pa /tmp/krb5cc_ Ns Ar uid" -compact
231 .It Pa /tmp/krb5cc_ Ns Ar uid
232 default credentials cache
234 is the decimal UID of the user).
235 .It Pa $HOME/.k5login
236 file containing Kerberos principals that are allowed access.
245 Applications should not call
247 more than once between calls to
251 when using the Kerberos 5 PAM module.
252 .Sh SECURITY CONSIDERATIONS
255 module implements what is fundamentally a password authentication scheme.
256 It does not use a Kerberos 5 exchange between client and server, but rather
257 authenticates the password provided by the client against the Kerberos KDC.
258 Therefore, care should be taken to only use this module over a secure session
260 secure TTY, encrypted session, etc.
262 otherwise the user's Kerberos 5 password could be compromised.