Merge branch 'vendor/OPENSSL'
[dragonfly.git] / lib / pam_module / pam_krb5 / pam_krb5.8
1 .\"
2 .\" $Id: pam_krb5.5,v 1.5 2000/01/05 00:59:56 fcusack Exp $
3 .\" $FreeBSD: src/lib/libpam/modules/pam_krb5/pam_krb5.8,v 1.6 2001/11/24 23:41:32 dd Exp $
4 .\" $DragonFly: src/lib/pam_module/pam_krb5/pam_krb5.8,v 1.1 2005/07/12 23:04:02 joerg Exp $
5 .Dd January 15, 1999
6 .Dt PAM_KRB5 8
7 .Os
8 .Sh NAME
9 .Nm pam_krb5
10 .Nd Kerberos 5 PAM module
11 .Sh SYNOPSIS
12 .Pa /usr/lib/pam_krb5.so
13 .Sh DESCRIPTION
14 The Kerberos 5 service module for PAM, typically
15 .Pa /usr/lib/pam_krb5.so ,
16 provides functionality for three PAM categories:
17 authentication,
18 account management,
19 and password management.
20 It also provides null functions for session management.
21 The
22 .Pa pam_krb5.so
23 module is a shared object
24 that can be dynamically loaded to provide
25 the necessary functionality upon demand.
26 Its path is specified in the
27 PAM configuration file.
28 .Ss Kerberos 5 Authentication Module
29 The Kerberos 5 authentication component
30 provides functions to verify the identity of a user
31 .Pq Fn pam_sm_authenticate
32 and to set user specific credentials
33 .Pq Fn pam_sm_setcred .
34 .Fn pam_sm_authenticate
35 converts the supplied username into a Kerberos principal,
36 by appending the default local realm name.
37 It also supports usernames with explicit realm names.
38 If a realm name is supplied, then upon a successful return, it
39 changes the username by mapping the principal name into a local username
40 (calling
41 .Fn krb5_aname_to_localname ) .
42 This typically just means
43 the realm name is stripped.
44 .Pp
45 It prompts the user for a password and obtains a new Kerberos TGT for
46 the principal.
47 The TGT is verified by obtaining a service
48 ticket for the local host.
49 .Pp
50 When prompting for the current password, the authentication
51 module will use the prompt
52 .Dq Li "Password for <principal>:" .
53 .Pp
54 The
55 .Fn pam_sm_setcred
56 function stores the newly acquired credentials in a credentials cache,
57 and sets the environment variable
58 .Ev KRB5CCNAME
59 appropriately.
60 The credentials cache should be destroyed by the user at logout with
61 .Xr kdestroy 1 .
62 .Pp
63 The following options may be passed to the authentication module:
64 .Bl -tag -width ".Cm use_first_pass"
65 .It Cm debug
66 .Xr syslog 3
67 debugging information at
68 .Dv LOG_DEBUG
69 level.
70 .It Cm no_warn
71 suppress warning messages to the user.
72 These messages include
73 reasons why the user's
74 authentication attempt was declined.
75 .It Cm use_first_pass
76 If the authentication module is not the first in the stack,
77 and a previous module obtained the user's password, that password is
78 used to authenticate the user.
79 If this fails, the authentication
80 module returns failure without prompting the user for a password.
81 This option has no effect if the authentication module is
82 the first in the stack, or if no previous modules obtained the
83 user's password.
84 .It Cm try_first_pass
85 This option is similar to the
86 .Cm use_first_pass
87 option, except that if the previously obtained password fails, the
88 user is prompted for another password.
89 .It Cm forwardable
90 Obtain forwardable Kerberos credentials for the user.
91 .It Cm no_ccache
92 Do not save the obtained credentials in a credentials cache.
93 This is a
94 useful option if the authentication module is used for services such
95 as ftp or pop, where the user would not be able to destroy them.
96 [This
97 is not a recommendation to use the module for those services.]
98 .It Cm ccache Ns = Ns Ar name
99 Use
100 .Ar name
101 as the credentials cache.
102 .Ar name
103 must be in the form
104 .Ar type : Ns Ar residual .
105 The special tokens
106 .Ql %u ,
107 to designate the decimal UID of the user;
108 and
109 .Ql %p ,
110 to designate the current process ID; can be used in
111 .Ar name .
112 .El
113 .Ss Kerberos 5 Account Management Module
114 The Kerberos 5 account management component
115 provides a function to perform account management,
116 .Fn pam_sm_acct_mgmt .
117 The function verifies that the authenticated principal is allowed
118 to login to the local user account by calling
119 .Fn krb5_kuserok
120 (which checks the user's
121 .Pa .k5login
122 file).
123 .Ss Kerberos 5 Password Management Module
124 The Kerberos 5 password management component
125 provides a function to change passwords
126 .Pq Fn pam_sm_chauthtok .
127 The username supplied (the
128 user running the
129 .Xr passwd 1
130 command, or the username given as an argument) is mapped into
131 a Kerberos principal name, using the same technique as in
132 the authentication module.
133 Note that if a realm name was
134 explicitly supplied during authentication, but not during
135 a password change, the mapping
136 done by the password management module may not result in the
137 same principal as was used for authentication.
138 .Pp
139 Unlike when
140 changing a
141 .Ux
142 password, the password management module will
143 allow any user to change any principal's password (if the user knows
144 the principal's old password, of course).
145 Also unlike
146 .Ux ,
147 root
148 is always prompted for the principal's old password.
149 .Pp
150 The password management module uses the same heuristics as
151 .Xr kpasswd 1
152 to determine how to contact the Kerberos password server.
153 .Pp
154 The following options may be passed to the password management
155 module:
156 .Bl -tag -width ".Cm use_first_pass"
157 .It Cm debug
158 .Xr syslog 3
159 debugging information at
160 .Dv LOG_DEBUG
161 level.
162 .It Cm use_first_pass
163 If the password management module is not the first in the stack,
164 and a previous module obtained the user's old password, that password is
165 used to authenticate the user.
166 If this fails, the password
167 management
168 module returns failure without prompting the user for the old password.
169 If successful, the new password entered to the previous module is also
170 used as the new Kerberos password.
171 If the new password fails,
172 the password management module returns failure without
173 prompting the user for a new password.
174 .It Cm try_first_pass
175 This option is similar to the
176 .Cm use_first_pass
177 option, except that if the previously obtained old or new passwords fail,
178 the user is prompted for them.
179 .El
180 .Ss Kerberos 5 Session Management Module
181 The Kerberos 5 session management component
182 provides functions to initiate
183 .Pq Fn pam_sm_open_session
184 and terminate
185 .Pq Fn pam_sm_close_session
186 sessions.
187 Since session management is not defined under Kerberos 5,
188 both of these functions simply return success.
189 They are provided
190 only because of the naming conventions for PAM modules.
191 .Sh ENVIRONMENT
192 .Bl -tag -width "KRB5CCNAME"
193 .It Ev KRB5CCNAME
194 Location of the credentials cache.
195 .El
196 .Sh FILES
197 .Bl -tag -width ".Pa /tmp/krb5cc_ Ns Ar uid" -compact
198 .It Pa /tmp/krb5cc_ Ns Ar uid
199 default credentials cache
200 .Ar ( uid
201 is the decimal UID of the user).
202 .It Pa $HOME/.k5login
203 file containing Kerberos principals that are allowed access.
204 .El
205 .Sh SEE ALSO
206 .Xr kdestroy 1 ,
207 .Xr passwd 1 ,
208 .Xr syslog 3 ,
209 .Xr pam.conf 5 ,
210 .Xr pam 8
211 .Sh NOTES
212 Applications should not call
213 .Fn pam_authenticate
214 more than once between calls to
215 .Fn pam_start
216 and
217 .Fn pam_end
218 when using the Kerberos 5 PAM module.