1*bf6873c5SCy Schubert=for stopwords 2*bf6873c5SCy SchubertKRB5CCNAME ChallengeResponseAuthentication GSS-API Heimdal KDC PKINIT 3*bf6873c5SCy SchubertPasswordAuthentication SRV Solaris Sourceforge aname appdefaults auth 4*bf6873c5SCy Schubertcanonicalized ccache krb5.conf forwardable kdestroy keytab libdefaults 5*bf6873c5SCy Schubertlogout pam-krb5 preauth 0.8rc1 screensaver screensavers sshd localname 6*bf6873c5SCy Schubertkrb5.conf. 0.8rc1. Allbery Cusack Salomon FSFAP SPDX-License-Identifier 7*bf6873c5SCy Schubertresponder 8*bf6873c5SCy Schubert 9*bf6873c5SCy Schubert=head1 NAME 10*bf6873c5SCy Schubert 11*bf6873c5SCy Schubertpam_krb5 - Kerberos PAM module 12*bf6873c5SCy Schubert 13*bf6873c5SCy Schubert=head1 SYNOPSIS 14*bf6873c5SCy Schubert 15*bf6873c5SCy Schubert auth sufficient pam_krb5.so minimum_uid=1000 16*bf6873c5SCy Schubert session required pam_krb5.so minimum_uid=1000 17*bf6873c5SCy Schubert account required pam_krb5.so minimum_uid=1000 18*bf6873c5SCy Schubert password sufficient pam_krb5.so minimum_uid=1000 19*bf6873c5SCy Schubert 20*bf6873c5SCy Schubert=head1 DESCRIPTION 21*bf6873c5SCy Schubert 22*bf6873c5SCy SchubertThe Kerberos service module for PAM, typically installed at 23*bf6873c5SCy SchubertF</lib/security/pam_krb5.so>, provides functionality for the four PAM 24*bf6873c5SCy Schubertoperations: authentication, account management, session management, and 25*bf6873c5SCy Schubertpassword management. F<pam_krb5.so> is a shared object that is 26*bf6873c5SCy Schubertdynamically loaded by the PAM subsystem as necessary, based on the system 27*bf6873c5SCy SchubertPAM configuration. PAM is a system for plugging in external 28*bf6873c5SCy Schubertauthentication and session management modules so that each application 29*bf6873c5SCy Schubertdoesn't have to know the best way to check user authentication or create a 30*bf6873c5SCy Schubertuser session on that system. For details on how to configure PAM on your 31*bf6873c5SCy Schubertsystem, see the PAM man page, often pam(7). 32*bf6873c5SCy Schubert 33*bf6873c5SCy SchubertHere are the actions of this module when called from each group: 34*bf6873c5SCy Schubert 35*bf6873c5SCy Schubert=over 4 36*bf6873c5SCy Schubert 37*bf6873c5SCy Schubert=item auth 38*bf6873c5SCy Schubert 39*bf6873c5SCy SchubertProvides implementations of pam_authenticate() and pam_setcred(). The 40*bf6873c5SCy Schubertformer takes the username from the PAM session, prompts for the user's 41*bf6873c5SCy Schubertpassword (unless configured to use an already-entered password), and then 42*bf6873c5SCy Schubertperforms a Kerberos initial authentication, storing the obtained 43*bf6873c5SCy Schubertcredentials (if successful) in a temporary ticket cache. The latter, 44*bf6873c5SCy Schubertdepending on the flags it is called with, either takes the contents of the 45*bf6873c5SCy Schuberttemporary ticket cache and writes it out to a persistent ticket cache 46*bf6873c5SCy Schubertowned by the user or uses the temporary ticket cache to refresh an 47*bf6873c5SCy Schubertexisting user ticket cache. 48*bf6873c5SCy Schubert 49*bf6873c5SCy SchubertPasswords as long or longer than PAM_MAX_RESP_SIZE octets (normally 512 50*bf6873c5SCy Schubertoctets) will be rejected, since excessively long passwords can be used as 51*bf6873c5SCy Schuberta denial of service attack. 52*bf6873c5SCy Schubert 53*bf6873c5SCy SchubertAfter doing the initial authentication, the Kerberos PAM module will 54*bf6873c5SCy Schubertattempt to obtain tickets for a key in the local system keytab and then 55*bf6873c5SCy Schubertverify those tickets. Unless this step is performed, the authentication 56*bf6873c5SCy Schubertis vulnerable to KDC spoofing, but it requires that the system have a 57*bf6873c5SCy Schubertlocal key and that the PAM module be running as a user that can read the 58*bf6873c5SCy Schubertkeytab file (normally F</etc/krb5.keytab>. You can point the Kerberos PAM 59*bf6873c5SCy Schubertmodule at a different keytab with the I<keytab> option. If that keytab 60*bf6873c5SCy Schubertcannot be read or if no keys are found in it, the default (potentially 61*bf6873c5SCy Schubertinsecure) behavior is to skip this check. If you want to instead fail 62*bf6873c5SCy Schubertauthentication if the obtained tickets cannot be checked, set 63*bf6873c5SCy SchubertC<verify_ap_req_nofail> to true in the [libdefaults] section of 64*bf6873c5SCy SchubertF</etc/krb5.conf>. Note that this will affect applications other than 65*bf6873c5SCy Schubertthis PAM module. 66*bf6873c5SCy Schubert 67*bf6873c5SCy SchubertBy default, whenever the user is authenticated, a basic authorization 68*bf6873c5SCy Schubertcheck will also be done using krb5_kuserok(). The default behavior of 69*bf6873c5SCy Schubertthis function is to check the user's account for a F<.k5login> file and, 70*bf6873c5SCy Schubertif one is present, ensure that the user's principal is listed in that 71*bf6873c5SCy Schubertfile. If F<.k5login> is not present, the default check is to ensure that 72*bf6873c5SCy Schubertthe user's principal is in the default local realm and the user portion of 73*bf6873c5SCy Schubertthe principal matches the account name (this can be changed by configuring 74*bf6873c5SCy Schuberta custom aname to localname mapping in F<krb5.conf>; see the Kerberos 75*bf6873c5SCy Schubertdocumentation for details). This can be customized with several 76*bf6873c5SCy Schubertconfiguration options; see below. 77*bf6873c5SCy Schubert 78*bf6873c5SCy SchubertIf the username provided to PAM contains an C<@> and Kerberos can, 79*bf6873c5SCy Schuberttreating the username as a principal, map it to a local account name, 80*bf6873c5SCy Schubertpam_authenticate() will change the PAM user to that local account name. 81*bf6873c5SCy SchubertThis allows users to log in with their Kerberos principal and let Kerberos 82*bf6873c5SCy Schubertdo the mapping to an account. This can be disabled with the 83*bf6873c5SCy SchubertI<no_update_user> option. Be aware, however, that this facility cannot be 84*bf6873c5SCy Schubertused with OpenSSH. OpenSSH will reject usernames that don't match local 85*bf6873c5SCy Schubertaccounts before this remapping can be done and will pass an invalid 86*bf6873c5SCy Schubertpassword to the PAM module. Also be aware that several other common PAM 87*bf6873c5SCy Schubertmodules, such as pam_securetty, expect to be able to look up the user with 88*bf6873c5SCy Schubertgetpwnam() and cannot be called before pam_krb5 when using this feature. 89*bf6873c5SCy Schubert 90*bf6873c5SCy SchubertWhen pam_setcred() is called to initialize a new ticket cache, the 91*bf6873c5SCy Schubertenvironment variable KRB5CCNAME is set to the path to that ticket cache. 92*bf6873c5SCy SchubertBy default, the cache will be named F</tmp/krb5cc_UID_RANDOM> where UID is 93*bf6873c5SCy Schubertthe user's UID and RANDOM is six randomly-chosen letters. This can be 94*bf6873c5SCy Schubertconfigured with the I<ccache> and I<ccache_dir> options. 95*bf6873c5SCy Schubert 96*bf6873c5SCy Schubertpam-krb5 does not use the default ticket cache location or 97*bf6873c5SCy SchubertI<default_cc_name> in the C<[libdefaults]> section of F<krb5.conf>. The 98*bf6873c5SCy Schubertdefault cache location would share a cache for all sessions of the same 99*bf6873c5SCy Schubertuser, which causes confusing behavior when the user logs out of one of 100*bf6873c5SCy Schubertmultiple sessions. 101*bf6873c5SCy Schubert 102*bf6873c5SCy SchubertIf pam_setcred() initializes a new ticket cache, it will also set up that 103*bf6873c5SCy Schubertticket cache so that it will be deleted when the PAM session is closed. 104*bf6873c5SCy SchubertNormally, the calling program (B<login>, B<sshd>, etc.) will run the 105*bf6873c5SCy Schubertuser's shell as a sub-process, wait for it to exit, and then close the PAM 106*bf6873c5SCy Schubertsession, thereby cleaning up the user's session. 107*bf6873c5SCy Schubert 108*bf6873c5SCy Schubert=item session 109*bf6873c5SCy Schubert 110*bf6873c5SCy SchubertProvides implementations of pam_open_session(), which is equivalent to 111*bf6873c5SCy Schubertcalling pam_setcred() with the PAM_ESTABLISH_CRED flag, and 112*bf6873c5SCy Schubertpam_close_session(), which destroys the ticket cache created by 113*bf6873c5SCy Schubertpam_setcred(). 114*bf6873c5SCy Schubert 115*bf6873c5SCy Schubert=item account 116*bf6873c5SCy Schubert 117*bf6873c5SCy SchubertProvides an implementation of pam_acct_mgmt(). All it does is do the same 118*bf6873c5SCy Schubertauthorization check as performed by the pam_authenticate() implementation 119*bf6873c5SCy Schubertdescribed above. 120*bf6873c5SCy Schubert 121*bf6873c5SCy Schubert=item password 122*bf6873c5SCy Schubert 123*bf6873c5SCy SchubertProvides an implementation of pam_chauthtok(), which implements password 124*bf6873c5SCy Schubertchanges. The user is prompted for their existing password (unless 125*bf6873c5SCy Schubertconfigured to use an already entered one) and the PAM module then obtains 126*bf6873c5SCy Schubertcredentials for the special Kerberos principal C<kadmin/changepw>. It 127*bf6873c5SCy Schubertthen prompts the user for a new password, twice to ensure that the user 128*bf6873c5SCy Schubertentered it properly (again, unless configured to use an already entered 129*bf6873c5SCy Schubertpassword), and then does a Kerberos password change. 130*bf6873c5SCy Schubert 131*bf6873c5SCy SchubertPasswords as long or longer than PAM_MAX_RESP_SIZE octets (normally 512 132*bf6873c5SCy Schubertoctets) will be rejected, since excessively long passwords can be used as 133*bf6873c5SCy Schuberta denial of service attack. 134*bf6873c5SCy Schubert 135*bf6873c5SCy SchubertUnlike the normal Unix password module, this module will allow any user to 136*bf6873c5SCy Schubertchange any other user's password if they know the old password. Also, 137*bf6873c5SCy Schubertunlike the normal Unix password module, root will always be prompted for 138*bf6873c5SCy Schubertthe old password, since root has no special status in Kerberos. (To 139*bf6873c5SCy Schubertchange passwords in Kerberos without knowing the old password, use 140*bf6873c5SCy Schubertkadmin(8) instead.) 141*bf6873c5SCy Schubert 142*bf6873c5SCy Schubert=back 143*bf6873c5SCy Schubert 144*bf6873c5SCy SchubertBoth the account and session management calls of the Kerberos PAM module 145*bf6873c5SCy Schubertwill return PAM_IGNORE if called in the context of a PAM session for a 146*bf6873c5SCy Schubertuser who did not authenticate with Kerberos (a return code of C<ignore> in 147*bf6873c5SCy Schubertthe Linux PAM configuration language). 148*bf6873c5SCy Schubert 149*bf6873c5SCy SchubertNote that this module assumes the network is available in order to do a 150*bf6873c5SCy SchubertKerberos authentication. If the network is not available, some Kerberos 151*bf6873c5SCy Schubertlibraries have timeouts longer than the timeout imposed by the login 152*bf6873c5SCy Schubertprocess. This means that using this module incautiously can make it 153*bf6873c5SCy Schubertimpossible to log on to console as root. For this reason, you should 154*bf6873c5SCy Schubertalways use the I<ignore_root> or I<minimum_uid> options, list a local 155*bf6873c5SCy Schubertauthentication module such as B<pam_unix> first with a control field of 156*bf6873c5SCy SchubertC<sufficient> so that the Kerberos PAM module will be skipped if local 157*bf6873c5SCy Schubertpassword authentication was successful. 158*bf6873c5SCy Schubert 159*bf6873c5SCy SchubertThis is not the same PAM module as the Kerberos PAM module available from 160*bf6873c5SCy SchubertSourceforge, or the one included on Red Hat systems. It supports many of 161*bf6873c5SCy Schubertthe same options, has some additional options, and doesn't support some of 162*bf6873c5SCy Schubertthe options those modules do. 163*bf6873c5SCy Schubert 164*bf6873c5SCy Schubert=head1 CONFIGURATION 165*bf6873c5SCy Schubert 166*bf6873c5SCy SchubertThe Kerberos PAM module takes many options, not all of which are relevant 167*bf6873c5SCy Schubertto every PAM group; options that are not relevant will be silently 168*bf6873c5SCy Schubertignored. Any of these options can be set in the PAM configuration as 169*bf6873c5SCy Schubertarguments listed after C<pam_krb5.so>. Some of the options can also be 170*bf6873c5SCy Schubertset in the system F<krb5.conf> file; if this is possible, it will be noted 171*bf6873c5SCy Schubertbelow in the option description. 172*bf6873c5SCy Schubert 173*bf6873c5SCy SchubertTo set a boolean option in the PAM configuration file, just give the name 174*bf6873c5SCy Schubertof the option in the arguments. To set an option that takes an argument, 175*bf6873c5SCy Schubertfollow the option name with an equal sign (=) and the value, with no 176*bf6873c5SCy Schubertseparating whitespace. Whitespace in option arguments is not supported in 177*bf6873c5SCy Schubertthe PAM configuration. 178*bf6873c5SCy Schubert 179*bf6873c5SCy SchubertTo set an option for the PAM module in the system F<krb5.conf> file, put 180*bf6873c5SCy Schubertthat option in the C<[appdefaults]> section. All options must be followed 181*bf6873c5SCy Schubertby an equal sign (=) and a value, so for boolean options add C<= true>. 182*bf6873c5SCy SchubertThe Kerberos PAM module will look for options either at the top level of 183*bf6873c5SCy Schubertthe C<[appdefaults]> section or in a subsection named C<pam>, inside or 184*bf6873c5SCy Schubertoutside a section for the realm. For example, the following fragment of a 185*bf6873c5SCy SchubertF<krb5.conf> file would set I<forwardable> to true, I<minimum_uid> to 186*bf6873c5SCy Schubert1000, and set I<ignore_k5login> only if the realm is EXAMPLE.COM. 187*bf6873c5SCy Schubert 188*bf6873c5SCy Schubert [appdefaults] 189*bf6873c5SCy Schubert forwardable = true 190*bf6873c5SCy Schubert pam = { 191*bf6873c5SCy Schubert minimum_uid = 1000 192*bf6873c5SCy Schubert EXAMPLE.COM = { 193*bf6873c5SCy Schubert ignore_k5login = true 194*bf6873c5SCy Schubert } 195*bf6873c5SCy Schubert } 196*bf6873c5SCy Schubert 197*bf6873c5SCy SchubertFor more information on the syntax of F<krb5.conf>, see krb5.conf(5). 198*bf6873c5SCy SchubertNote that options that depend on the realm will be set only on the basis 199*bf6873c5SCy Schubertof the default realm, either as configured in krb5.conf(5) or as set by 200*bf6873c5SCy Schubertthe I<realm> option described below. If the user authenticates to an 201*bf6873c5SCy Schubertaccount qualified with a realm, that realm will not be used when 202*bf6873c5SCy Schubertdetermining which options will apply. 203*bf6873c5SCy Schubert 204*bf6873c5SCy SchubertThere is no difference to the PAM module whether options are specified at 205*bf6873c5SCy Schubertthe top level or in a C<pam> section; the C<pam> section is supported in 206*bf6873c5SCy Schubertcase there are options that should be set for the PAM module but not for 207*bf6873c5SCy Schubertother applications. 208*bf6873c5SCy Schubert 209*bf6873c5SCy SchubertIf the same option is set in F<krb5.conf> and in the PAM configuration, 210*bf6873c5SCy Schubertthe latter takes precedent. Note, however, that due to the configuration 211*bf6873c5SCy Schubertsyntax, there's no way to turn off a boolean option in the PAM 212*bf6873c5SCy Schubertconfiguration that was turned on in F<krb5.conf>. 213*bf6873c5SCy Schubert 214*bf6873c5SCy SchubertThe start of each option description is annotated with the version of 215*bf6873c5SCy Schubertpam-krb5 in which that option was added with the current meaning. 216*bf6873c5SCy Schubert 217*bf6873c5SCy Schubert=head2 Authorization 218*bf6873c5SCy Schubert 219*bf6873c5SCy Schubert=over 4 220*bf6873c5SCy Schubert 221*bf6873c5SCy Schubert=item alt_auth_map=<format> 222*bf6873c5SCy Schubert 223*bf6873c5SCy Schubert[3.12] This functions similarly to the I<search_k5login> option. The 224*bf6873c5SCy Schubert<format> argument is used as the authentication Kerberos principal, with 225*bf6873c5SCy Schubertany C<%s> in <format> replaced with the username. If the username 226*bf6873c5SCy Schubertcontains an C<@>, only the part of the username before the realm is used 227*bf6873c5SCy Schubertto replace C<%s>. If <format> contains a realm, it will be used; 228*bf6873c5SCy Schubertotherwise, the realm of the username (if any) will be appended to the 229*bf6873c5SCy Schubertresult. There is no quote removal. 230*bf6873c5SCy Schubert 231*bf6873c5SCy SchubertIf this option is present, the default behavior is to try this alternate 232*bf6873c5SCy Schubertprincipal first and then fall back to the standard behavior if it fails. 233*bf6873c5SCy SchubertThe primary usage is to allow alternative principals to be used for 234*bf6873c5SCy Schubertauthentication in programs like B<sudo>. Most examples will look like: 235*bf6873c5SCy Schubert 236*bf6873c5SCy Schubert alt_auth_map=%s/root 237*bf6873c5SCy Schubert 238*bf6873c5SCy Schubertwhich attempts authentication as the root instance of the username first 239*bf6873c5SCy Schubertand then falls back to the regular username (but see I<force_alt_auth> and 240*bf6873c5SCy SchubertI<only_alt_auth>). 241*bf6873c5SCy Schubert 242*bf6873c5SCy SchubertThis option also allows a cheap way to attempt authentication in an 243*bf6873c5SCy Schubertalternative realm first and then fall back to the primary realm. A 244*bf6873c5SCy Schubertsetting like: 245*bf6873c5SCy Schubert 246*bf6873c5SCy Schubert alt_auth_map=%s@EXAMPLE.COM 247*bf6873c5SCy Schubert 248*bf6873c5SCy Schubertwill attempt authentication in the EXAMPLE.COM realm first and then fall 249*bf6873c5SCy Schubertback on the local default realm. This is more convenient than running the 250*bf6873c5SCy Schubertmodule multiple times with multiple default realms set with I<realm>, but 251*bf6873c5SCy Schubertit is very limited: only two realms can be tried, and the alternate realm 252*bf6873c5SCy Schubertis always tried first. 253*bf6873c5SCy Schubert 254*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf>, although 255*bf6873c5SCy Schubertnormally it doesn't make sense to do that; normally it is used in the PAM 256*bf6873c5SCy Schubertoptions of configuration for specific programs. It is only applicable to 257*bf6873c5SCy Schubertthe auth and account groups. If this option is set for the auth group, be 258*bf6873c5SCy Schubertsure to set it for the account group as well or account authorization may 259*bf6873c5SCy Schubertfail. 260*bf6873c5SCy Schubert 261*bf6873c5SCy Schubert=item force_alt_auth 262*bf6873c5SCy Schubert 263*bf6873c5SCy Schubert[3.12] This option is used with I<alt_auth_map> and forces authentication 264*bf6873c5SCy Schubertas the mapped principal if that principal exists in the KDC. Only if the 265*bf6873c5SCy SchubertKDC returns principal unknown does the Kerberos PAM module fall back to 266*bf6873c5SCy Schubertnormal authentication. This can be used to force authentication with an 267*bf6873c5SCy Schubertalternate instance. If I<alt_auth_map> is not set, it has no effect. 268*bf6873c5SCy Schubert 269*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf> and is only 270*bf6873c5SCy Schubertapplicable to the auth group. 271*bf6873c5SCy Schubert 272*bf6873c5SCy Schubert=item ignore_k5login 273*bf6873c5SCy Schubert 274*bf6873c5SCy Schubert[2.0] Never look for a F<.k5login> file in the user's home directory. 275*bf6873c5SCy SchubertInstead, only check that the Kerberos principal maps to the local account 276*bf6873c5SCy Schubertname. The default check is to ensure the realm matches the local realm 277*bf6873c5SCy Schubertand the user portion of the principal matches the local account name, but 278*bf6873c5SCy Schubertthis can be customized by setting up an aname to localname mapping in 279*bf6873c5SCy SchubertF<krb5.conf>. 280*bf6873c5SCy Schubert 281*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf> and is only 282*bf6873c5SCy Schubertapplicable to the auth and account groups. 283*bf6873c5SCy Schubert 284*bf6873c5SCy Schubert=item ignore_root 285*bf6873c5SCy Schubert 286*bf6873c5SCy Schubert[1.1] Do not do anything if the username is C<root>. The authentication 287*bf6873c5SCy Schubertand password calls will silently fail (allowing that status to be ignored 288*bf6873c5SCy Schubertvia a control of C<optional> or C<sufficient>), and the account and 289*bf6873c5SCy Schubertsession calls (including pam_setcred) will return PAM_IGNORE, telling the 290*bf6873c5SCy SchubertPAM library to proceed as if they weren't mentioned in the PAM 291*bf6873c5SCy Schubertconfiguration. This option is supported and will remain, but normally you 292*bf6873c5SCy Schubertwant to use I<minimum_uid> instead. 293*bf6873c5SCy Schubert 294*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf>. 295*bf6873c5SCy Schubert 296*bf6873c5SCy Schubert=item minimum_uid=<uid> 297*bf6873c5SCy Schubert 298*bf6873c5SCy Schubert[2.0] Do not do anything if the authenticated account name corresponds to 299*bf6873c5SCy Schuberta local account and that local account has a UID lower than <uid>. If 300*bf6873c5SCy Schubertboth of those conditions are true, the authentication and password calls 301*bf6873c5SCy Schubertwill silently fail (allowing that status to be ignored via a control of 302*bf6873c5SCy SchubertC<optional> or C<sufficient>), and the account and session calls 303*bf6873c5SCy Schubert(including pam_setcred) will return PAM_IGNORE, telling the PAM library to 304*bf6873c5SCy Schubertproceed as if they weren't mentioned in the PAM configuration. 305*bf6873c5SCy Schubert 306*bf6873c5SCy SchubertUsing this option is highly recommended if you don't need to use Kerberos 307*bf6873c5SCy Schubertto authenticate password logins to the root account (which isn't 308*bf6873c5SCy Schubertrecommended since Kerberos requires a network connection). It provides 309*bf6873c5SCy Schubertsome defense in depth against user principals that happen to match a 310*bf6873c5SCy Schubertsystem account incorrectly authenticating as that system account. 311*bf6873c5SCy Schubert 312*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf>. 313*bf6873c5SCy Schubert 314*bf6873c5SCy Schubert=item only_alt_auth 315*bf6873c5SCy Schubert 316*bf6873c5SCy Schubert[3.12] This option is used with I<alt_auth_map> and forces the use of the 317*bf6873c5SCy Schubertmapped principal for authentication. It disables fallback to normal 318*bf6873c5SCy Schubertauthentication in all cases and overrides I<search_k5login> and 319*bf6873c5SCy SchubertI<force_alt_auth>. If I<alt_auth_map> is not set, it has no effect and 320*bf6873c5SCy Schubertthe standard authentication behavior is used. 321*bf6873c5SCy Schubert 322*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf> and is only 323*bf6873c5SCy Schubertapplicable to the auth group. 324*bf6873c5SCy Schubert 325*bf6873c5SCy Schubert=item search_k5login 326*bf6873c5SCy Schubert 327*bf6873c5SCy Schubert[2.0] Normally, the Kerberos implementation of pam_authenticate attempts 328*bf6873c5SCy Schubertto obtain tickets for the authenticating username in the local realm. If 329*bf6873c5SCy Schubertthis option is set and the local user has a F<.k5login> file in their home 330*bf6873c5SCy Schubertdirectory, the module will instead open and read that F<.k5login> file, 331*bf6873c5SCy Schubertattempting to use the supplied password to authenticate as each principal 332*bf6873c5SCy Schubertlisted there in turn. If any of those authentications succeed, the user 333*bf6873c5SCy Schubertwill be successfully authenticated; otherwise, authentication will fail. 334*bf6873c5SCy SchubertThis option is useful for allowing password authentication (via console or 335*bf6873c5SCy SchubertB<sshd> without GSS-API support) to shared accounts. If there is no 336*bf6873c5SCy SchubertF<.k5login> file, the behavior is the same as normal. Using this option 337*bf6873c5SCy Schubertrequires that the user's F<.k5login> file be readable at the time of 338*bf6873c5SCy Schubertauthentication. 339*bf6873c5SCy Schubert 340*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf> and is only 341*bf6873c5SCy Schubertapplicable to the auth group. 342*bf6873c5SCy Schubert 343*bf6873c5SCy Schubert=back 344*bf6873c5SCy Schubert 345*bf6873c5SCy Schubert=head2 Kerberos Behavior 346*bf6873c5SCy Schubert 347*bf6873c5SCy Schubert=over 4 348*bf6873c5SCy Schubert 349*bf6873c5SCy Schubert=item anon_fast 350*bf6873c5SCy Schubert 351*bf6873c5SCy Schubert[4.6] Attempt to use Flexible Authentication Secure Tunneling (FAST) by 352*bf6873c5SCy Schubertfirst authenticating as the anonymous user (WELLKNOWN/ANONYMOUS) and using 353*bf6873c5SCy Schubertits credentials as the FAST armor. This requires anonymous PKINIT be 354*bf6873c5SCy Schubertenabled for the local realm, that PKINIT be configured on the local 355*bf6873c5SCy Schubertsystem, and that the Kerberos library support FAST and anonymous PKINIT. 356*bf6873c5SCy Schubert 357*bf6873c5SCy SchubertFAST is a mechanism to protect Kerberos against password guessing attacks 358*bf6873c5SCy Schubertand provide other security improvements. To work, FAST requires that a 359*bf6873c5SCy Schubertticket be obtained with a strong key to protect exchanges with potentially 360*bf6873c5SCy Schubertweaker user passwords. This option uses anonymous authentication to 361*bf6873c5SCy Schubertobtain that key and then uses it to protect the subsequent authentication. 362*bf6873c5SCy Schubert 363*bf6873c5SCy SchubertIf anonymous PKINIT is not available or fails, FAST will not be used and 364*bf6873c5SCy Schubertthe authentication will proceed as normal. 365*bf6873c5SCy Schubert 366*bf6873c5SCy SchubertTo instead use an existing ticket cache for the FAST credentials, use 367*bf6873c5SCy SchubertI<fast_ccache> instead of this option. If both I<fast_ccache> and 368*bf6873c5SCy SchubertI<anon_fast> are set, the ticket cache named by I<fast_ccache> will be 369*bf6873c5SCy Schuberttried first, and the Kerberos PAM module will fall back on attempting 370*bf6873c5SCy Schubertanonymous PKINIT if that cache could not be used. 371*bf6873c5SCy Schubert 372*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf> and is only 373*bf6873c5SCy Schubertapplicable to the auth and password groups. 374*bf6873c5SCy Schubert 375*bf6873c5SCy SchubertThe operation is the same as if using the I<fast_ccache> option, but the 376*bf6873c5SCy Schubertcache is created and destroyed automatically. If both I<fast_ccache> and 377*bf6873c5SCy SchubertI<anon_fast> options are used, the I<fast_ccache> takes precedent and no 378*bf6873c5SCy Schubertanonymous authentication is done. 379*bf6873c5SCy Schubert 380*bf6873c5SCy Schubert=item fast_ccache=<ccache_name> 381*bf6873c5SCy Schubert 382*bf6873c5SCy Schubert[4.3] The same as I<anon_fast>, but use an existing Kerberos ticket cache 383*bf6873c5SCy Schubertrather than anonymous PKINIT. This allows use of FAST with a realm that 384*bf6873c5SCy Schubertdoesn't support PKINIT or doesn't support anonymous authentication. 385*bf6873c5SCy Schubert 386*bf6873c5SCy Schubert<ccache_name> should be a credential cache containing a ticket obtained 387*bf6873c5SCy Schubertusing a strong key, such as the randomized key for the host principal of 388*bf6873c5SCy Schubertthe local system. If <ccache_name> names a ticket cache that is readable 389*bf6873c5SCy Schubertby the authenticating process and has tickets then FAST will be attempted. 390*bf6873c5SCy SchubertThe easiest way to use this option is to use a program like B<k5start> to 391*bf6873c5SCy Schubertmaintain a ticket cache using the host's keytab. This ticket cache should 392*bf6873c5SCy Schubertnormally only be readable by root, so this option will not be able to 393*bf6873c5SCy Schubertprotect authentications done as non-root users (such as screensavers). 394*bf6873c5SCy Schubert 395*bf6873c5SCy SchubertIf no credentials are present in the ticket cache, or if the ticket cache 396*bf6873c5SCy Schubertdoes not exist or is not readable, FAST will not used and authentication 397*bf6873c5SCy Schubertwill proceed as normal. However, if the credentials in that ticket cache 398*bf6873c5SCy Schubertare expired, authentication will fail if the KDC supports FAST. 399*bf6873c5SCy Schubert 400*bf6873c5SCy SchubertTo use anonymous PKINIT to protect the FAST exchange, use the I<anon_fast> 401*bf6873c5SCy Schubertoption instead. I<anon_fast> is easier to configure, since no existing 402*bf6873c5SCy Schubertticket cache is required, but requires PKINIT be available and configured 403*bf6873c5SCy Schubertand that the local realm support anonymous authentication. If both 404*bf6873c5SCy SchubertI<fast_ccache> and I<anon_fast> are set, the ticket cache named by 405*bf6873c5SCy SchubertI<fast_ccache> will be tried first, and the Kerberos PAM module will fall 406*bf6873c5SCy Schubertback on attempting anonymous PKINIT if that cache could not be used. 407*bf6873c5SCy Schubert 408*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf> and is only 409*bf6873c5SCy Schubertapplicable to the auth and password groups. 410*bf6873c5SCy Schubert 411*bf6873c5SCy Schubert=item forwardable 412*bf6873c5SCy Schubert 413*bf6873c5SCy Schubert[1.0] Obtain forwardable tickets. If set (to either true or false, 414*bf6873c5SCy Schubertalthough it can only be set to false in F<krb5.conf>), this overrides the 415*bf6873c5SCy SchubertKerberos library default set in the [libdefaults] section of F<krb5.conf>. 416*bf6873c5SCy Schubert 417*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf> and is only 418*bf6873c5SCy Schubertapplicable to the auth group. 419*bf6873c5SCy Schubert 420*bf6873c5SCy Schubert=item keytab=<path> 421*bf6873c5SCy Schubert 422*bf6873c5SCy Schubert[3.0] Specifies the keytab to use when validating the user's credentials. 423*bf6873c5SCy SchubertThe default is the default system keytab (normally F</etc/krb5.keytab>), 424*bf6873c5SCy Schubertwhich is usually only readable by root. Applications not running as root 425*bf6873c5SCy Schubertthat use this PAM module for authentication may wish to point it to 426*bf6873c5SCy Schubertanother keytab the application can read. The first principal found in the 427*bf6873c5SCy Schubertkeytab will be used as the principal for credential verification. 428*bf6873c5SCy Schubert 429*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf> and is only 430*bf6873c5SCy Schubertapplicable to the auth group. 431*bf6873c5SCy Schubert 432*bf6873c5SCy Schubert=item realm=<realm> 433*bf6873c5SCy Schubert 434*bf6873c5SCy Schubert[2.2] Set the default Kerberos realm and obtain credentials in that realm, 435*bf6873c5SCy Schubertrather than in the normal default realm for this system. If this option 436*bf6873c5SCy Schubertis used, it should be set for all groups being used for consistent 437*bf6873c5SCy Schubertresults. This setting will affect authorization decisions since it 438*bf6873c5SCy Schubertchanges the default realm. This setting will also change the service 439*bf6873c5SCy Schubertprincipal used to verify the obtained credentials to be in the specified 440*bf6873c5SCy Schubertrealm. 441*bf6873c5SCy Schubert 442*bf6873c5SCy SchubertIf you only want to set the realm assumed for user principals without 443*bf6873c5SCy Schubertchanging the realm for authorization decisions or the service principal 444*bf6873c5SCy Schubertused to verify credentials, see the I<user_realm> option. 445*bf6873c5SCy Schubert 446*bf6873c5SCy Schubert=item renew_lifetime=<lifetime> 447*bf6873c5SCy Schubert 448*bf6873c5SCy Schubert[2.0] Obtain renewable tickets with a maximum renewable lifetime of 449*bf6873c5SCy Schubert<lifetime>. <lifetime> should be a Kerberos lifetime string such as 450*bf6873c5SCy SchubertC<2d4h10m> or a time in minutes. If set, this overrides the Kerberos 451*bf6873c5SCy Schubertlibrary default set in the [libdefaults] section of F<krb5.conf>. 452*bf6873c5SCy Schubert 453*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf> and is only 454*bf6873c5SCy Schubertapplicable to the auth group. 455*bf6873c5SCy Schubert 456*bf6873c5SCy Schubert=item ticket_lifetime=<lifetime> 457*bf6873c5SCy Schubert 458*bf6873c5SCy Schubert[3.0] Obtain tickets with a maximum lifetime of <lifetime>. <lifetime> 459*bf6873c5SCy Schubertshould be a Kerberos lifetime string such as C<2d4h10m> or a time in 460*bf6873c5SCy Schubertminutes. If set, this overrides the Kerberos library default set in the 461*bf6873c5SCy Schubert[libdefaults] section of F<krb5.conf>. 462*bf6873c5SCy Schubert 463*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf> and is only 464*bf6873c5SCy Schubertapplicable to the auth group. 465*bf6873c5SCy Schubert 466*bf6873c5SCy Schubert=item user_realm 467*bf6873c5SCy Schubert 468*bf6873c5SCy Schubert[4.6] Obtain credentials in the specified realm rather than in the default 469*bf6873c5SCy Schubertrealm for this system. If this option is used, it should be set for all 470*bf6873c5SCy Schubertgroups being used for consistent results (although the account group 471*bf6873c5SCy Schubertcurrently doesn't care about realm). This will not change authorization 472*bf6873c5SCy Schubertdecisions. If the obtained credentials are supposed to allow access to a 473*bf6873c5SCy Schubertshell account, the user will need an appropriate F<.k5login> file entry or 474*bf6873c5SCy Schubertthe system will have to have a custom aname_to_localname mapping. 475*bf6873c5SCy Schubert 476*bf6873c5SCy Schubert=back 477*bf6873c5SCy Schubert 478*bf6873c5SCy Schubert=head2 PAM Behavior 479*bf6873c5SCy Schubert 480*bf6873c5SCy Schubert=over 4 481*bf6873c5SCy Schubert 482*bf6873c5SCy Schubert=item clear_on_fail 483*bf6873c5SCy Schubert 484*bf6873c5SCy Schubert[3.9] When changing passwords, PAM first does a preliminary check through 485*bf6873c5SCy Schubertthe complete password stack, and then calls each module again to do the 486*bf6873c5SCy Schubertpassword change. After that preliminary check, the order of module 487*bf6873c5SCy Schubertinvocation is fixed. This means that even if the Kerberos password change 488*bf6873c5SCy Schubertfails (or if one of the other password changes in the stack fails), other 489*bf6873c5SCy Schubertpassword PAM modules in the stack will still be called even if the failing 490*bf6873c5SCy Schubertmodule is marked required or requisite. When using multiple password PAM 491*bf6873c5SCy Schubertmodules to synchronize passwords between multiple systems when they 492*bf6873c5SCy Schubertchange, this behavior can cause unwanted differences between the 493*bf6873c5SCy Schubertenvironments. 494*bf6873c5SCy Schubert 495*bf6873c5SCy SchubertSetting this option provides a way to work around this behavior. If this 496*bf6873c5SCy Schubertoption is set and a Kerberos password change is attempted and fails (due 497*bf6873c5SCy Schubertto network errors or password strength checking on the KDC, for example), 498*bf6873c5SCy Schubertthis module will clear the stored password in the PAM stack. This will 499*bf6873c5SCy Schubertforce any subsequent modules that have I<use_authtok> set to fail so that 500*bf6873c5SCy Schubertthose environments won't get out of sync with the password in Kerberos. 501*bf6873c5SCy SchubertThe Kerberos PAM module will not meddle with the stored password if it 502*bf6873c5SCy Schubertskips the user due to configuration such as minimum_uid. 503*bf6873c5SCy Schubert 504*bf6873c5SCy SchubertUnfortunately, setting this option interferes with other desirable PAM 505*bf6873c5SCy Schubertconfigurations, such as attempting to change the password in Kerberos 506*bf6873c5SCy Schubertfirst and falling back on the local Unix password database if that fails. 507*bf6873c5SCy SchubertIt therefore isn't the default. Turn it on (and list pam_krb5 first after 508*bf6873c5SCy Schubertpam_cracklib if used) when synchronizing passwords between multiple 509*bf6873c5SCy Schubertenvironments. 510*bf6873c5SCy Schubert 511*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf> and is only 512*bf6873c5SCy Schubertapplicable to the password group. 513*bf6873c5SCy Schubert 514*bf6873c5SCy Schubert=item debug 515*bf6873c5SCy Schubert 516*bf6873c5SCy Schubert[1.0] Log more verbose trace and debugging information to syslog at 517*bf6873c5SCy SchubertLOG_DEBUG priority, including entry and exit from each of the external PAM 518*bf6873c5SCy Schubertinterfaces (except pam_close_session). 519*bf6873c5SCy Schubert 520*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf>. 521*bf6873c5SCy Schubert 522*bf6873c5SCy Schubert=item defer_pwchange 523*bf6873c5SCy Schubert 524*bf6873c5SCy Schubert[3.11] By default, pam-krb5 lets the Kerberos library handle prompting for 525*bf6873c5SCy Schuberta password change if an account's password is expired during the auth 526*bf6873c5SCy Schubertgroup. If this fails, pam_authenticate() returns an error. 527*bf6873c5SCy Schubert 528*bf6873c5SCy SchubertAccording to the PAM standard, this is not the correct way to handle 529*bf6873c5SCy Schubertexpired passwords. Instead, pam_authenticate() should return success 530*bf6873c5SCy Schubertwithout attempting a password change, and then pam_acct_mgmt() should 531*bf6873c5SCy Schubertreturn PAM_NEW_AUTHTOK_REQD, at which point the calling application is 532*bf6873c5SCy Schubertresponsible for either rejecting the authentication or calling 533*bf6873c5SCy Schubertpam_chauthtok(). However, following the standard requires that all 534*bf6873c5SCy Schubertapplications call pam_acct_mgmt() and check its return status; otherwise, 535*bf6873c5SCy Schubertexpired accounts may be able to successfully authenticate. Many 536*bf6873c5SCy Schubertapplications do not do this. 537*bf6873c5SCy Schubert 538*bf6873c5SCy SchubertIf this option is set, pam-krb5 uses the fully correct PAM mechanism for 539*bf6873c5SCy Schuberthandling expired accounts instead of failing in pam_authenticate(). Due 540*bf6873c5SCy Schubertto the security risk of widespread broken applications, be very careful 541*bf6873c5SCy Schubertabout enabling this option. It should normally only be turned on to solve 542*bf6873c5SCy Schuberta specific problem (such as using Solaris Kerberos libraries that don't 543*bf6873c5SCy Schubertsupport prompting for password changes during authentication), and then 544*bf6873c5SCy Schubertonly for specific applications known to call pam_acct_mgmt() and check its 545*bf6873c5SCy Schubertreturn status properly. 546*bf6873c5SCy Schubert 547*bf6873c5SCy SchubertThis option is only supported when pam-krb5 is built with MIT Kerberos. 548*bf6873c5SCy SchubertIf built against Heimdal, this option does nothing and normal expired 549*bf6873c5SCy Schubertpassword change handling still happens. (Heimdal is missing the required 550*bf6873c5SCy SchubertAPI to implement this option, at least as of version 1.6.) 551*bf6873c5SCy Schubert 552*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf> and is only 553*bf6873c5SCy Schubertapplicable to the auth group. 554*bf6873c5SCy Schubert 555*bf6873c5SCy Schubert=item fail_pwchange 556*bf6873c5SCy Schubert 557*bf6873c5SCy Schubert[4.2] By default, pam-krb5 lets the Kerberos library handle prompting for 558*bf6873c5SCy Schuberta password change if an account's password is expired during the auth 559*bf6873c5SCy Schubertgroup. If this option is set, expired passwords are instead treated as an 560*bf6873c5SCy Schubertauthentication failure identical to an incorrect password. Also see 561*bf6873c5SCy SchubertI<defer_pwchange> and I<force_pwchange>. 562*bf6873c5SCy Schubert 563*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf> and is only 564*bf6873c5SCy Schubertapplicable to the auth group. 565*bf6873c5SCy Schubert 566*bf6873c5SCy Schubert=item force_pwchange 567*bf6873c5SCy Schubert 568*bf6873c5SCy Schubert[3.11] If this option is set and authentication fails with a Kerberos 569*bf6873c5SCy Schuberterror indicating the user's password is expired, attempt to immediately 570*bf6873c5SCy Schubertchange their password during the authenticate step. Under normal 571*bf6873c5SCy Schubertcircumstances, this is unnecessary. Most Kerberos libraries will do this 572*bf6873c5SCy Schubertfor you, and setting this option will prompt the user twice to change 573*bf6873c5SCy Schuberttheir password if the first attempt (done by the Kerberos library) fails. 574*bf6873c5SCy SchubertHowever, some system Kerberos libraries (such as Solaris's) have password 575*bf6873c5SCy Schubertchange prompting disabled in the Kerberos library; on those systems, you 576*bf6873c5SCy Schubertcan set this option to simulate the normal library behavior. 577*bf6873c5SCy Schubert 578*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf> and is only 579*bf6873c5SCy Schubertapplicable to the auth group. 580*bf6873c5SCy Schubert 581*bf6873c5SCy Schubert=item no_update_user 582*bf6873c5SCy Schubert 583*bf6873c5SCy Schubert[4.7] Normally, if pam-krb5 is able to canonicalize the principal to a 584*bf6873c5SCy Schubertlocal name using krb5_aname_to_localname() or similar calls, it changes 585*bf6873c5SCy Schubertthe PAM_USER variable for this PAM session to the canonicalized local 586*bf6873c5SCy Schubertname. Setting this option disables this behavior and leaves PAM_USER set 587*bf6873c5SCy Schubertto the initial authentication identity. 588*bf6873c5SCy Schubert 589*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf> and is only 590*bf6873c5SCy Schubertapplicable to the auth group. 591*bf6873c5SCy Schubert 592*bf6873c5SCy Schubert=item silent 593*bf6873c5SCy Schubert 594*bf6873c5SCy Schubert[1.0] Don't show messages and errors from Kerberos, such as warnings of 595*bf6873c5SCy Schubertexpiring passwords, to the user via the prompter. This is equivalent to 596*bf6873c5SCy Schubertthe behavior when the application passes in PAM_SILENT, but can be set in 597*bf6873c5SCy Schubertthe PAM configuration. 598*bf6873c5SCy Schubert 599*bf6873c5SCy SchubertThis option is only applicable to the auth and password groups. 600*bf6873c5SCy Schubert 601*bf6873c5SCy Schubert=item trace=<log-file> 602*bf6873c5SCy Schubert 603*bf6873c5SCy Schubert[4.6] Enables Kerberos library trace logging to the specified log file if 604*bf6873c5SCy Schubertit is supported by the Kerberos library. This is intended for temporary 605*bf6873c5SCy Schubertdebugging. The specified file will be appended to without further 606*bf6873c5SCy Schubertsecurity checks, so do not specify a file in a publicly writable directory 607*bf6873c5SCy Schubertlike F</tmp>. 608*bf6873c5SCy Schubert 609*bf6873c5SCy Schubert=back 610*bf6873c5SCy Schubert 611*bf6873c5SCy Schubert=head2 PKINIT 612*bf6873c5SCy Schubert 613*bf6873c5SCy Schubert=over 4 614*bf6873c5SCy Schubert 615*bf6873c5SCy Schubert=item pkinit_anchors=<anchors> 616*bf6873c5SCy Schubert 617*bf6873c5SCy Schubert[3.0] When doing PKINIT authentication, use <anchors> as the client trust 618*bf6873c5SCy Schubertanchors. This is normally a reference to a file containing the trusted 619*bf6873c5SCy Schubertcertificate authorities. This option is only used if I<try_pkinit> or 620*bf6873c5SCy SchubertI<use_pkinit> are set. 621*bf6873c5SCy Schubert 622*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf> and is only 623*bf6873c5SCy Schubertapplicable to the auth and password groups. 624*bf6873c5SCy Schubert 625*bf6873c5SCy Schubert=item pkinit_prompt 626*bf6873c5SCy Schubert 627*bf6873c5SCy Schubert[3.0] Before attempting PKINIT authentication, prompt the user to insert a 628*bf6873c5SCy Schubertsmart card. You may want to set this option for programs such as 629*bf6873c5SCy SchubertB<gnome-screensaver> that call PAM as soon as the mouse is touched and 630*bf6873c5SCy Schubertdon't give the user an opportunity to enter the smart card first. Any 631*bf6873c5SCy Schubertinformation entered at the first prompt is ignored. If I<try_pkinit> is 632*bf6873c5SCy Schubertset, a user who wishes to use a password instead can just press Enter and 633*bf6873c5SCy Schubertthen enter their password as normal. This option is only used if 634*bf6873c5SCy SchubertI<try_pkinit> or I<use_pkinit> are set. 635*bf6873c5SCy Schubert 636*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf> and is only 637*bf6873c5SCy Schubertapplicable to the auth and password groups. 638*bf6873c5SCy Schubert 639*bf6873c5SCy Schubert=item pkinit_user=<userid> 640*bf6873c5SCy Schubert 641*bf6873c5SCy Schubert[3.0] When doing PKINIT authentication, use <userid> as the user ID. The 642*bf6873c5SCy Schubertvalue of this string is highly dependent on the type of PKINIT 643*bf6873c5SCy Schubertimplementation you're using, but will generally be something like: 644*bf6873c5SCy Schubert 645*bf6873c5SCy Schubert PKCS11:/usr/lib/pkcs11/lib/soft-pkcs11.so 646*bf6873c5SCy Schubert 647*bf6873c5SCy Schubertto specify the module to use with a smart card. It may also point to a 648*bf6873c5SCy Schubertuser certificate or to other types of user IDs. See the Kerberos library 649*bf6873c5SCy Schubertdocumentation for more details. This option is only used if I<try_pkinit> 650*bf6873c5SCy Schubertor I<use_pkinit> are set. 651*bf6873c5SCy Schubert 652*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf> and is only 653*bf6873c5SCy Schubertapplicable to the auth and password groups. 654*bf6873c5SCy Schubert 655*bf6873c5SCy Schubert=item preauth_opt=<option> 656*bf6873c5SCy Schubert 657*bf6873c5SCy Schubert[3.3] Sets a preauth option (currently only applicable when built with MIT 658*bf6873c5SCy SchubertKerberos). <option> is either a key/value pair with the key separated 659*bf6873c5SCy Schubertfrom the value by C<=> or a boolean option (in which case it's turned on). 660*bf6873c5SCy SchubertIn F<krb5.conf>, multiple options should be separated by whitespace. In 661*bf6873c5SCy Schubertthe PAM configuration, this option can be given multiple times to set 662*bf6873c5SCy Schubertmultiple options. In either case, <option> may not contain whitespace. 663*bf6873c5SCy Schubert 664*bf6873c5SCy SchubertThe primary use of this option, at least in the near future, will be to 665*bf6873c5SCy Schubertset options for the MIT Kerberos PKINIT support. For the full list of 666*bf6873c5SCy Schubertpossible options, see the PKINIT plugin documentation. At the time of 667*bf6873c5SCy Schubertthis writing, C<X509_user_identity> is equivalent to I<pkinit_user> and 668*bf6873c5SCy SchubertC<X509_anchors> is equivalent to I<pkinit_anchors>. C<flag_DSA_PROTOCOL> 669*bf6873c5SCy Schubertcan only be set via this option. 670*bf6873c5SCy Schubert 671*bf6873c5SCy SchubertAny settings made with this option are applied after the I<pkinit_anchors> 672*bf6873c5SCy Schubertand I<pkinit_user> options, so if an equivalent setting is made via 673*bf6873c5SCy SchubertI<preauth_opt>, it will probably override the other setting. 674*bf6873c5SCy Schubert 675*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf> and is only 676*bf6873c5SCy Schubertapplicable to the auth and password groups. Note that there is no way to 677*bf6873c5SCy Schubertremove a setting made in F<krb5.conf> using the PAM configuration, but 678*bf6873c5SCy Schubertoptions set in the PAM configuration are applied after options set in 679*bf6873c5SCy SchubertF<krb5.conf> and therefore may override earlier settings. 680*bf6873c5SCy Schubert 681*bf6873c5SCy Schubert=item try_pkinit 682*bf6873c5SCy Schubert 683*bf6873c5SCy Schubert[3.0] Attempt PKINIT authentication before trying a regular password. You 684*bf6873c5SCy Schubertwill probably also need to set the I<pkinit_user> configuration option. 685*bf6873c5SCy SchubertIf PKINIT fails, the PAM module will fall back on regular password 686*bf6873c5SCy Schubertauthentication. This option is currently only supported if pam-krb5 was 687*bf6873c5SCy Schubertbuilt against Heimdal 0.8rc1 or later or MIT Kerberos 1.6.3 or later. 688*bf6873c5SCy Schubert 689*bf6873c5SCy SchubertIf this option is set and pam-krb5 is built against MIT Kerberos, and 690*bf6873c5SCy SchubertPKINIT fails and the module falls back to password authentication, the 691*bf6873c5SCy Schubertuser's password will not be stored in the PAM stack for subsequent 692*bf6873c5SCy Schubertmodules. This is a bug in the interaction between the module and MIT 693*bf6873c5SCy SchubertKerberos that requires some reworking of the PKINIT authentication method 694*bf6873c5SCy Schubertto fix. 695*bf6873c5SCy Schubert 696*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf> and is only 697*bf6873c5SCy Schubertapplicable to the auth and password groups. 698*bf6873c5SCy Schubert 699*bf6873c5SCy Schubert=item use_pkinit 700*bf6873c5SCy Schubert 701*bf6873c5SCy Schubert[3.0, 4.9 for MIT Kerberos] Require PKINIT authentication. You will 702*bf6873c5SCy Schubertprobably also need to set the I<pkinit_user> configuration option. If 703*bf6873c5SCy SchubertPKINIT fails, authentication will fail. This option is only supported if 704*bf6873c5SCy Schubertpam-krb5 was built against Heimdal 0.8rc1 or later or MIT Kerberos 1.12 or 705*bf6873c5SCy Schubertlater. 706*bf6873c5SCy Schubert 707*bf6873c5SCy SchubertBe aware that, with MIT Kerberos, this option is implemented by using a 708*bf6873c5SCy Schubertresponder without a prompter, and thus any informational messages from the 709*bf6873c5SCy SchubertKerberos libraries or KDC during authentication will not be displayed. 710*bf6873c5SCy Schubert 711*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf> and is only 712*bf6873c5SCy Schubertapplicable to the auth and password groups. 713*bf6873c5SCy Schubert 714*bf6873c5SCy Schubert=back 715*bf6873c5SCy Schubert 716*bf6873c5SCy Schubert=head2 Prompting 717*bf6873c5SCy Schubert 718*bf6873c5SCy Schubert=over 4 719*bf6873c5SCy Schubert 720*bf6873c5SCy Schubert=item banner=<banner> 721*bf6873c5SCy Schubert 722*bf6873c5SCy Schubert[3.0] By default, the prompts when a user changes their password are: 723*bf6873c5SCy Schubert 724*bf6873c5SCy Schubert Current Kerberos password: 725*bf6873c5SCy Schubert Enter new Kerberos password: 726*bf6873c5SCy Schubert Retype new Kerberos password: 727*bf6873c5SCy Schubert 728*bf6873c5SCy SchubertThe string "Kerberos" is inserted so that users aren't confused about 729*bf6873c5SCy Schubertwhich password they're changing. Setting this option replaces the word 730*bf6873c5SCy Schubert"Kerberos" with whatever this option is set to. Setting this option to 731*bf6873c5SCy Schubertthe empty string removes the word before "password:" entirely. 732*bf6873c5SCy Schubert 733*bf6873c5SCy SchubertIf set in the PAM configuration, <banner> may not contain whitespace. If 734*bf6873c5SCy Schubertyou want a value containing whitespace, set it in F<krb5.conf>. 735*bf6873c5SCy Schubert 736*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf> and is only 737*bf6873c5SCy Schubertapplicable to the password group. 738*bf6873c5SCy Schubert 739*bf6873c5SCy Schubert=item expose_account 740*bf6873c5SCy Schubert 741*bf6873c5SCy Schubert[3.0] By default, the Kerberos PAM module password prompt is simply 742*bf6873c5SCy Schubert"Password:". This avoids leaking any information about the system realm 743*bf6873c5SCy Schubertor account to principal conversions. If this option is set, the string 744*bf6873c5SCy Schubert"for <principal>" is added before the colon, where <principal> is the 745*bf6873c5SCy Schubertuser's principal. This string is also added before the colon on prompts 746*bf6873c5SCy Schubertwhen changing the user's password. 747*bf6873c5SCy Schubert 748*bf6873c5SCy SchubertEnabling this option with ChallengeResponseAuthentication enabled in 749*bf6873c5SCy SchubertOpenSSH may cause problems for some ssh clients that only recognize 750*bf6873c5SCy Schubert"Password:" as a prompt. This option is automatically disabled if 751*bf6873c5SCy SchubertI<search_k5login> is enabled since the principal displayed would be 752*bf6873c5SCy Schubertinaccurate. 753*bf6873c5SCy Schubert 754*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf> and is only 755*bf6873c5SCy Schubertapplicable to the auth and password groups. 756*bf6873c5SCy Schubert 757*bf6873c5SCy Schubert=item force_first_pass 758*bf6873c5SCy Schubert 759*bf6873c5SCy Schubert[4.0] Use the password obtained by a previous authentication or password 760*bf6873c5SCy Schubertmodule to authenticate the user without prompting the user again. If no 761*bf6873c5SCy Schubertprevious module obtained the user's password, fail without prompting the 762*bf6873c5SCy Schubertuser. Also see I<try_first_pass> and I<use_first_pass> for weaker 763*bf6873c5SCy Schubertversions of this option. 764*bf6873c5SCy Schubert 765*bf6873c5SCy SchubertThis option is only applicable to the auth and password groups. For the 766*bf6873c5SCy Schubertpassword group, it applies only to the old password. See I<use_authtok> 767*bf6873c5SCy Schubertfor a similar setting for the new password. 768*bf6873c5SCy Schubert 769*bf6873c5SCy Schubert=item no_prompt 770*bf6873c5SCy Schubert 771*bf6873c5SCy Schubert[4.6] Never prompt for the current password. Instead, pass in a NULL 772*bf6873c5SCy Schubertpassword to the Kerberos library and let the Kerberos library do the 773*bf6873c5SCy Schubertprompting. This may be needed if, for example, the Kerberos library is 774*bf6873c5SCy Schubertconfigured to use other authentication mechanisms than passwords and needs 775*bf6873c5SCy Schubertfull control over the prompting process. 776*bf6873c5SCy Schubert 777*bf6873c5SCy SchubertThe major disadvantage of this option is that it means the PAM module will 778*bf6873c5SCy Schubertnever see the user's password and therefore cannot save it in the PAM 779*bf6873c5SCy Schubertmodule data for any subsequent modules. In other words, this option 780*bf6873c5SCy Schubertcannot be used if another module is in the stack behind the Kerberos PAM 781*bf6873c5SCy Schubertmodule and wants to use I<use_first_pass>. The Kerberos library also 782*bf6873c5SCy Schubertusually includes the principal in the prompt, and therefore this option 783*bf6873c5SCy Schubertimplies behavior similar to I<expose_account>. Similar to 784*bf6873c5SCy SchubertI<expose_account>, this can cause problems with OpenSSH if 785*bf6873c5SCy SchubertChallengeResponseAuthentication is enabled, since clients may not 786*bf6873c5SCy Schubertrecognize password prompts other than "Password:". 787*bf6873c5SCy Schubert 788*bf6873c5SCy SchubertUsing this option with I<search_k5login> would result in a password prompt 789*bf6873c5SCy Schubertfor every principal listed in the user's F<.k5login> file. This is 790*bf6873c5SCy Schubertprobably not desired behavior, although it's not prohibited by the module. 791*bf6873c5SCy Schubert 792*bf6873c5SCy SchubertThis option is only applicable to the auth and password groups. For the 793*bf6873c5SCy Schubertpassword group, it applies only to the authentication process; the user 794*bf6873c5SCy Schubertwill still be prompted for a new password. 795*bf6873c5SCy Schubert 796*bf6873c5SCy Schubert=item prompt_principal 797*bf6873c5SCy Schubert 798*bf6873c5SCy Schubert[3.6] Before prompting for the user's password (or using the previously 799*bf6873c5SCy Schubertentered password, if I<try_first_pass>, I<use_first_pass>, or 800*bf6873c5SCy SchubertI<force_first_pass> are set), prompt the user for the Kerberos principal 801*bf6873c5SCy Schubertto use for authentication. This allows the user to authenticate with a 802*bf6873c5SCy Schubertdifferent principal than the one corresponding to the local username, 803*bf6873c5SCy Schubertprovided that either a F<.k5login> file or local Kerberos principal to 804*bf6873c5SCy Schubertaccount mapping authorize that principal to access the local account. 805*bf6873c5SCy Schubert 806*bf6873c5SCy SchubertBe cautious when using this configuration option and don't use it with 807*bf6873c5SCy SchubertOpenSSH PasswordAuthentication, only ChallengeResponseAuthentication. 808*bf6873c5SCy SchubertSome PAM-enabled applications expect PAM modules to only prompt for 809*bf6873c5SCy Schubertpasswords and may even blindly give the password to the first prompt, no 810*bf6873c5SCy Schubertmatter what it is. Such applications, in combination with this option, 811*bf6873c5SCy Schubertmay expose the user's password in log messages and Kerberos requests. 812*bf6873c5SCy Schubert 813*bf6873c5SCy Schubert=item try_first_pass 814*bf6873c5SCy Schubert 815*bf6873c5SCy Schubert[1.0] If the authentication module isn't the first on the stack, and a 816*bf6873c5SCy Schubertprevious module obtained the user's password, use that password to 817*bf6873c5SCy Schubertauthenticate the user without prompting them again. If that 818*bf6873c5SCy Schubertauthentication fails, fall back on prompting the user for their password. 819*bf6873c5SCy SchubertThis option has no effect if the authentication module is first in the 820*bf6873c5SCy Schubertstack or if no previous module obtained the user's password. Also see 821*bf6873c5SCy SchubertI<use_first_pass> and I<force_first_pass> for stronger versions of this 822*bf6873c5SCy Schubertoption. 823*bf6873c5SCy Schubert 824*bf6873c5SCy SchubertThis option is only applicable to the auth and password groups. For the 825*bf6873c5SCy Schubertpassword group, it applies only to the old password. 826*bf6873c5SCy Schubert 827*bf6873c5SCy Schubert=item use_authtok 828*bf6873c5SCy Schubert 829*bf6873c5SCy Schubert[4.0] Use the new password obtained by a previous password module when 830*bf6873c5SCy Schubertchanging passwords rather than prompting for the new password. If the new 831*bf6873c5SCy Schubertpassword isn't available, fail. This can be used to require passwords be 832*bf6873c5SCy Schubertchecked by another, prior module, such as B<pam_cracklib>. 833*bf6873c5SCy Schubert 834*bf6873c5SCy SchubertThis option is only applicable to the password group. 835*bf6873c5SCy Schubert 836*bf6873c5SCy Schubert=item use_first_pass 837*bf6873c5SCy Schubert 838*bf6873c5SCy Schubert[1.0] Use the password obtained by a previous authentication module to 839*bf6873c5SCy Schubertauthenticate the user without prompting the user again. If no previous 840*bf6873c5SCy Schubertmodule obtained the user's password for either an authentication or 841*bf6873c5SCy Schubertpassword change, fall back on prompting the user. If a previous module 842*bf6873c5SCy Schubertdid obtain the user's password but authentication with that password 843*bf6873c5SCy Schubertfails, fail without further prompting the user. Also see 844*bf6873c5SCy SchubertI<try_first_pass> and I<force_first_pass> for other versions of this 845*bf6873c5SCy Schubertoption. 846*bf6873c5SCy Schubert 847*bf6873c5SCy SchubertThis option is only applicable to the auth and password groups. For the 848*bf6873c5SCy Schubertpassword group, it applies only to the old password. See I<use_authtok> 849*bf6873c5SCy Schubertfor a similar setting for the new password. 850*bf6873c5SCy Schubert 851*bf6873c5SCy Schubert=back 852*bf6873c5SCy Schubert 853*bf6873c5SCy Schubert=head2 Ticket Caches 854*bf6873c5SCy Schubert 855*bf6873c5SCy Schubert=over 4 856*bf6873c5SCy Schubert 857*bf6873c5SCy Schubert=item ccache=<pattern> 858*bf6873c5SCy Schubert 859*bf6873c5SCy Schubert[2.0] Use <pattern> as the pattern for creating credential cache names. 860*bf6873c5SCy Schubert<pattern> must be in the form <type>:<residual> where <type> and the 861*bf6873c5SCy Schubertfollowing colon are optional if a file cache should be used. The special 862*bf6873c5SCy Schuberttoken C<%u>, anywhere in <pattern>, is replaced with the user's numeric 863*bf6873c5SCy SchubertUID. The special token C<%p>, anywhere in <pattern>, is replaced with the 864*bf6873c5SCy Schubertcurrent process ID. 865*bf6873c5SCy Schubert 866*bf6873c5SCy SchubertIf <pattern> ends in the literal string C<XXXXXX> (six X's), that string 867*bf6873c5SCy Schubertwill be replaced by randomly generated characters and the ticket cache 868*bf6873c5SCy Schubertwill be created using mkstemp(3). This is strongly recommended if 869*bf6873c5SCy Schubert<pattern> points to a world-writable directory. 870*bf6873c5SCy Schubert 871*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf> and is only 872*bf6873c5SCy Schubertapplicable to the auth and session groups. 873*bf6873c5SCy Schubert 874*bf6873c5SCy Schubert=item ccache_dir=<directory> 875*bf6873c5SCy Schubert 876*bf6873c5SCy Schubert[1.2] Store both the temporary ticket cache used during authentication and 877*bf6873c5SCy Schubertuser ticket caches in <directory> instead of in F</tmp>. The algorithm 878*bf6873c5SCy Schubertfor generating the ticket cache name is otherwise unchanged. <directory> 879*bf6873c5SCy Schubertmay be prefixed with C<FILE:> to make the cache type unambiguous (and this 880*bf6873c5SCy Schubertmay be required on systems that use a cache type other than file as the 881*bf6873c5SCy Schubertdefault). 882*bf6873c5SCy Schubert 883*bf6873c5SCy SchubertBe aware that pam_krb5 creates and stores a temporary ticket cache file 884*bf6873c5SCy Schubertowned by root during the login process. If you set I<ccache> above to 885*bf6873c5SCy Schubertavoid using the system F</tmp> directory for user ticket caches, you may 886*bf6873c5SCy Schubertalso want to set I<ccache_dir> to move those temporary caches to some 887*bf6873c5SCy Schubertother location. This will allow pam_krb5 to continue working even if the 888*bf6873c5SCy Schubertsystem F</tmp> directory is full. 889*bf6873c5SCy Schubert 890*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf> and is only 891*bf6873c5SCy Schubertapplicable to the auth and session groups. 892*bf6873c5SCy Schubert 893*bf6873c5SCy Schubert=item no_ccache 894*bf6873c5SCy Schubert 895*bf6873c5SCy Schubert[1.0] Do not create a ticket cache after authentication. This option 896*bf6873c5SCy Schubertshouldn't be set in general, but is useful as part of the PAM 897*bf6873c5SCy Schubertconfiguration for a particular service that uses PAM for authentication 898*bf6873c5SCy Schubertbut isn't creating user sessions and doesn't want the overhead of ever 899*bf6873c5SCy Schubertwriting the user credentials to disk. When using this option, the 900*bf6873c5SCy Schubertapplication should only call pam_authenticate(); other functions like 901*bf6873c5SCy Schubertpam_setcred(), pam_start_session(), and pam_acct_mgmt() don't make sense 902*bf6873c5SCy Schubertwith this option. Don't use this option if the application needs PAM 903*bf6873c5SCy Schubertaccount and session management calls. 904*bf6873c5SCy Schubert 905*bf6873c5SCy SchubertThis option is only applicable to the auth group. 906*bf6873c5SCy Schubert 907*bf6873c5SCy Schubert=item retain_after_close 908*bf6873c5SCy Schubert 909*bf6873c5SCy Schubert[2.3] Normally, the user's ticket cache is destroyed when either pam_end() 910*bf6873c5SCy Schubertor pam_close_session() is called by the authenticating application so that 911*bf6873c5SCy Schubertticket caches aren't left behind after the user logs out. In some cases, 912*bf6873c5SCy Schuberthowever, this isn't desirable. (On Solaris 8, for instance, the default 913*bf6873c5SCy Schubertbehavior means login will destroy the ticket cache before running the 914*bf6873c5SCy Schubertuser's shell.) If this option is set, the PAM module will never destroy 915*bf6873c5SCy Schubertthe user's ticket cache. If you set this, you may want to call 916*bf6873c5SCy SchubertB<kdestroy> in the shell's logout configuration or run a temporary file 917*bf6873c5SCy Schubertremoval program to avoid accumulating hundreds of ticket caches in 918*bf6873c5SCy SchubertF</tmp>. 919*bf6873c5SCy Schubert 920*bf6873c5SCy SchubertThis option can be set in C<[appdefaults]> in F<krb5.conf> and is only 921*bf6873c5SCy Schubertapplicable to the auth and session groups. 922*bf6873c5SCy Schubert 923*bf6873c5SCy Schubert=back 924*bf6873c5SCy Schubert 925*bf6873c5SCy Schubert=head1 ENVIRONMENT 926*bf6873c5SCy Schubert 927*bf6873c5SCy Schubert=over 4 928*bf6873c5SCy Schubert 929*bf6873c5SCy Schubert=item KRB5CCNAME 930*bf6873c5SCy Schubert 931*bf6873c5SCy SchubertSet by pam_setcred() with the PAM_ESTABLISH_CRED option, and therefore 932*bf6873c5SCy Schubertalso by pam_open_session(), to point to the new credential cache for the 933*bf6873c5SCy Schubertuser. See the I<ccache> and I<ccache_dir> options. By default, the cache 934*bf6873c5SCy Schubertname will be prefixed with C<FILE:> to make the cache type unambiguous. 935*bf6873c5SCy Schubert 936*bf6873c5SCy Schubert=item PAM_KRB5CCNAME 937*bf6873c5SCy Schubert 938*bf6873c5SCy SchubertSet by pam_authenticate() to point to the temporary ticket cache used for 939*bf6873c5SCy Schubertauthentication (unless the I<no_ccache> option was given). pam_setcred() 940*bf6873c5SCy Schubertthen uses that environment variable to locate the temporary cache even if 941*bf6873c5SCy Schubertit was not called in the same PAM session as pam_authenticate() (a problem 942*bf6873c5SCy Schubertwith B<sshd> running in some modes). This environment variable is only 943*bf6873c5SCy Schubertused internal to the PAM module. 944*bf6873c5SCy Schubert 945*bf6873c5SCy Schubert=back 946*bf6873c5SCy Schubert 947*bf6873c5SCy Schubert=head1 FILES 948*bf6873c5SCy Schubert 949*bf6873c5SCy Schubert=over 4 950*bf6873c5SCy Schubert 951*bf6873c5SCy Schubert=item F</tmp/krb5cc_UID_RANDOM> 952*bf6873c5SCy Schubert 953*bf6873c5SCy SchubertThe default credential cache name. UID is the decimal UID of the local 954*bf6873c5SCy Schubertuser and RANDOM is a random six-character string. The pattern may be 955*bf6873c5SCy Schubertchanged with the I<ccache> option and the directory with the I<ccache_dir> 956*bf6873c5SCy Schubertoption. 957*bf6873c5SCy Schubert 958*bf6873c5SCy Schubert=item F</tmp/krb5cc_pam_RANDOM> 959*bf6873c5SCy Schubert 960*bf6873c5SCy SchubertThe credential cache name used for the temporary credential cache created 961*bf6873c5SCy Schubertby pam_authenticate(). This cache is removed again when the PAM session 962*bf6873c5SCy Schubertis ended or when pam_setcred() is called and will normally not be 963*bf6873c5SCy Schubertuser-visible. RANDOM is a random six-character string. 964*bf6873c5SCy Schubert 965*bf6873c5SCy Schubert=item F<~/.k5login> 966*bf6873c5SCy Schubert 967*bf6873c5SCy SchubertFile containing Kerberos principals that are allowed access to that 968*bf6873c5SCy Schubertaccount. 969*bf6873c5SCy Schubert 970*bf6873c5SCy Schubert=back 971*bf6873c5SCy Schubert 972*bf6873c5SCy Schubert=head1 BUGS 973*bf6873c5SCy Schubert 974*bf6873c5SCy SchubertIf I<try_pkinit> is set and pam-krb5 is built with MIT Kerberos, the 975*bf6873c5SCy Schubertuser's password is not saved in the PAM data if PKINIT fails and the 976*bf6873c5SCy Schubertmodule falls back to password authentication. 977*bf6873c5SCy Schubert 978*bf6873c5SCy Schubert=head1 CAVEATS 979*bf6873c5SCy Schubert 980*bf6873c5SCy SchubertBe sure to list this module in the session group as well as the auth group 981*bf6873c5SCy Schubertwhen using it for interactive logins. Otherwise, some applications (such 982*bf6873c5SCy Schubertas OpenSSH) will not set up the user's ticket cache correctly. 983*bf6873c5SCy Schubert 984*bf6873c5SCy SchubertThe Kerberos library, via pam-krb5, will prompt the user to change their 985*bf6873c5SCy Schubertpassword if their password is expired, but when using OpenSSH, this will 986*bf6873c5SCy Schubertonly work when ChallengeResponseAuthentication is enabled. Unless this 987*bf6873c5SCy Schubertoption is enabled, OpenSSH doesn't pass PAM messages to the user and can 988*bf6873c5SCy Schubertonly respond to a simple password prompt. 989*bf6873c5SCy Schubert 990*bf6873c5SCy SchubertIf you are using MIT Kerberos, be aware that users whose passwords are 991*bf6873c5SCy Schubertexpired will not be prompted to change their password unless the KDC 992*bf6873c5SCy Schubertconfiguration for your realm in [realms] in krb5.conf contains a 993*bf6873c5SCy Schubertmaster_kdc setting or, if using DNS SRV records, you have a DNS entry for 994*bf6873c5SCy Schubert_kerberos-master as well as _kerberos. 995*bf6873c5SCy Schubert 996*bf6873c5SCy Schubertpam_authenticate() returns failure when called for an ignored account, 997*bf6873c5SCy Schubertrequiring the system administrator to use C<optional> or C<sufficient> to 998*bf6873c5SCy Schubertignore the module and move on to the next module. It's arguably more 999*bf6873c5SCy Schubertcorrect to return PAM_IGNORE, which causes the module to be ignored as if 1000*bf6873c5SCy Schubertit weren't in the configuration, but this increases the risk of 1001*bf6873c5SCy Schubertinadvertent security holes when listing pam-krb5 as the only 1002*bf6873c5SCy Schubertauthentication module. 1003*bf6873c5SCy Schubert 1004*bf6873c5SCy SchubertThis module treats the empty password as an authentication failure 1005*bf6873c5SCy Schubertrather than attempting to use that password to avoid unwanted prompting 1006*bf6873c5SCy Schubertbehavior in the Kerberos libraries. If you have a Kerberos principal that 1007*bf6873c5SCy Schubertintentionally has an empty password, it won't work with this module. 1008*bf6873c5SCy Schubert 1009*bf6873c5SCy SchubertThis module will not refresh an existing ticket cache if called with an 1010*bf6873c5SCy Schuberteffective UID or GID different than the real UID or GID, since refreshing 1011*bf6873c5SCy Schubertan existing ticket cache requires trusting the KRB5CCNAME environment 1012*bf6873c5SCy Schubertvariable and the environment should not be trusted in a setuid context. 1013*bf6873c5SCy Schubert 1014*bf6873c5SCy SchubertOld versions of OpenSSH are known to call pam_authenticate followed by 1015*bf6873c5SCy Schubertpam_setcred(PAM_REINITIALIZE_CRED) without first calling pam_open_session, 1016*bf6873c5SCy Schubertthereby requesting that an existing ticket cache be renewed (similar to 1017*bf6873c5SCy Schubertwhat a screensaver would want) rather than requesting a new ticket cache 1018*bf6873c5SCy Schubertbe created. Since this behavior is indistinguishable at the PAM level 1019*bf6873c5SCy Schubertfrom a screensaver, pam-krb5 when used with these old versions of OpenSSH 1020*bf6873c5SCy Schubertwill refresh the ticket cache of the OpenSSH daemon rather than setting up 1021*bf6873c5SCy Schuberta new ticket cache for the user. The resulting ticket cache will have the 1022*bf6873c5SCy Schubertcorrect permissions, but will not be named correctly or referenced in the 1023*bf6873c5SCy Schubertuser's environment and will be overwritten by the next user login. The 1024*bf6873c5SCy Schubertbest solution to this problem is to upgrade OpenSSH. I'm not sure exactly 1025*bf6873c5SCy Schubertwhen this problem was fixed, but at the very least OpenSSH 4.3 and later 1026*bf6873c5SCy Schubertdo not exhibit it. 1027*bf6873c5SCy Schubert 1028*bf6873c5SCy Schubert=head1 AUTHOR 1029*bf6873c5SCy Schubert 1030*bf6873c5SCy Schubertpam-krb5 was originally written by Frank Cusack. Andres Salomon made 1031*bf6873c5SCy Schubertextensive modifications, and then Russ Allbery <eagle@eyrie.org> adopted 1032*bf6873c5SCy Schubertit and made even more extensive modifications. Russ Allbery currently 1033*bf6873c5SCy Schubertmaintains the module. 1034*bf6873c5SCy Schubert 1035*bf6873c5SCy Schubert=head1 COPYRIGHT AND LICENSE 1036*bf6873c5SCy Schubert 1037*bf6873c5SCy SchubertCopyright 2005-2010, 2014, 2020 Russ Allbery <eagle@eyrie.org> 1038*bf6873c5SCy Schubert 1039*bf6873c5SCy SchubertCopyright 2008-2014 The Board of Trustees of the Leland Stanford Junior 1040*bf6873c5SCy SchubertUniversity 1041*bf6873c5SCy Schubert 1042*bf6873c5SCy SchubertCopying and distribution of this file, with or without modification, are 1043*bf6873c5SCy Schubertpermitted in any medium without royalty provided the copyright notice and 1044*bf6873c5SCy Schubertthis notice are preserved. This file is offered as-is, without any 1045*bf6873c5SCy Schubertwarranty. 1046*bf6873c5SCy Schubert 1047*bf6873c5SCy SchubertSPDX-License-Identifier: FSFAP 1048*bf6873c5SCy Schubert 1049*bf6873c5SCy Schubert=head1 SEE ALSO 1050*bf6873c5SCy Schubert 1051*bf6873c5SCy Schubertkadmin(8), kdestroy(1), krb5.conf(5), pam(7), passwd(1), syslog(3) 1052*bf6873c5SCy Schubert 1053*bf6873c5SCy SchubertThe current version of this module is available from its web page at 1054*bf6873c5SCy SchubertL<https://www.eyrie.org/~eagle/software/pam-krb5/>. 1055*bf6873c5SCy Schubert 1056*bf6873c5SCy Schubert=cut 1057