---
name: "pam_krb5"
section: "8"
platform: "macos"
package: "pam_modules"
version: "217.100.6"
release: "macOS 26.5"
platforms: ["freebsd", "macos"]
url: "https://new.carta.tech/pam_krb5"
---

# pam\_krb5(8)

Kerberos 5 PAM module

## NAME

**pam\_krb5** – Kerberos 5 PAM module

## SYNOPSIS

\[*service-name*\] *function-class* *control-flag* pam\_krb5 \[*options*\]

## DESCRIPTION

The Kerberos 5 PAM module supports the authentication, account management and password management function classes. In terms of the *function-class* parameter, these are “auth” , “account” and “password” respectively.

### Kerberos 5 Authentication Module

The Kerberos 5 authentication component provides functions to verify the identity of a user (**pam\_sm\_authenticate**()) and to set user specific credentials (**pam\_sm\_setcred**()). **pam\_sm\_authenticate**() converts the supplied username into a Kerberos principal, by appending the default local realm name. It also supports usernames with explicit realm names. If a realm name is supplied, then upon a successful return, it changes the username by mapping the principal name into a local username (calling **krb5\_aname\_to\_localname**()). This typically just means the realm name is stripped.

It prompts the user for a password and obtains a new Kerberos TGT for the principal. The TGT is verified by obtaining a service ticket for the local host.

When prompting for the current password, the authentication module will use the prompt “Password for \<principal\>:”.

The **pam\_sm\_setcred**() function stores the newly acquired credentials in a credentials cache, and sets the environment variable KRB5CCNAME appropriately. The credentials cache should be destroyed by the user at logout with [kdestroy(1)](/kdestroy/1.md).

The following options may be passed to this authentication module:

- **debug**

  [openpam\_log(3)](/openpam_log/3.md) debugging information at \_LOG\_DEBUG level.

- **use\_first\_pass**

  If the authentication module is not the first in the stack, and a previous module obtained the user's password, that password is used to authenticate the user. If this fails, the authentication module returns failure without prompting the user for a password. This option has no effect if the authentication module is the first in the stack, or if no previous modules obtained the user's password.

- **try\_first\_pass**

  This option is similar to the **use\_first\_pass** option, except that if the previously obtained password fails, the user is prompted for another password.

- **forwardable**

  Obtain forwardable Kerberos credentials for the user.

- **no\_auth\_ccache**

  Do not save obtained credentials in a credentials cache during authorization.

- **no\_ccache**

  Do not save the obtained credentials in a credentials cache. This is a useful option if the authentication module is used for services such as ftp or pop, where the user would not be able to destroy them. \[This is not a recommendation to use the module for those services.\]

- **ccache**=*name*

  Use *name* as the credentials cache. *name* must be in the form *type*:*residual*. The special tokens ‘%u’, to designate the decimal UID of the user; and ‘%p’, to designate the current process ID; can be used in *name*.

- **default\_principal**

  Construct the principal from the authenticating user's username, rather than obtaining it from the AuthenticationAuthority of the  user's OpenDirectory record.

- **use\_kcminit**

  Don't verify password, instead store the password in kcm and return success in the pam chain.  So when used in this mode, the pam\_krb5 module needs to be configured to be ‘optional’ and some other module ‘required’.

### Kerberos 5 Account Management Module

The Kerberos 5 account management component provides a function to perform account management, **pam\_sm\_acct\_mgmt**(). The function verifies that the authenticated principal is allowed to login to the local user account by calling **krb5\_kuserok**() (which checks the user's *.k5login* file).

### Kerberos 5 Password Management Module

The Kerberos 5 password management component provides a function to change passwords (**pam\_sm\_chauthtok**()). The username supplied (the user running the [passwd(1)](/passwd/1.md) command, or the username given as an argument) is mapped into a Kerberos principal name, using the same technique as in the authentication module. Note that if a realm name was explicitly supplied during authentication, but not during a password change, the mapping done by the password management module may not result in the same principal as was used for authentication.

Unlike when changing a UNIX password, the password management module will allow any user to change any principal's password (if the user knows the principal's old password, of course). Also unlike UNIX, root is always prompted for the principal's old password.

The password management module uses the same heuristics as [kpasswd(1)](/kpasswd/1.md) to determine how to contact the Kerberos password server.

The following options may be passed to this password management module:

- **debug**

  [syslog(3)](/syslog/3.md) debugging information at LOG\_DEBUG level.

- **use\_first\_pass**

  If the password management module is not the first in the stack, and a previous module obtained the user's old password, that password is used to authenticate the user. If this fails, the password management module returns failure without prompting the user for the old password. If successful, the new password entered to the previous module is also used as the new Kerberos password. If the new password fails, the password management module returns failure without prompting the user for a new password.

- **try\_first\_pass**

  This option is similar to the **use\_first\_pass** option, except that if the previously obtained old or new passwords fail, the user is prompted for them.

## ENVIRONMENT

- KRB5CCNAME

  Location of the credentials cache.

## FILES

- */tmp/krb5cc\_**uid*

  default credentials cache (*uid* is the decimal UID of the user).

- *$HOME/.k5login*

  file containing Kerberos principals that are allowed access.

## SEE ALSO

[kdestroy(1)](/kdestroy/1.md), [passwd(1)](/passwd/1.md), [syslog(3)](/syslog/3.md), [pam.conf(5)](/pam.conf/5.md), DirectoryService(8), [pam(8)](/pam/8.md)

## NOTES

Applications should not call **pam\_authenticate**() more than once between calls to **pam\_start**() and **pam\_end**() when using the Kerberos 5 PAM module.
