---
name: "pam_chauthtok"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/pam_chauthtok"
---

# pam\_chauthtok(3)

perform password related functions within the PAM framework

## NAME

**pam\_chauthtok** – perform password related functions within the PAM framework

## SYNOPSIS

**#include \<sys/types.h\>**

**#include \<security/pam\_appl.h\>**

*int*\

**pam\_chauthtok**(*pam\_handle\_t \*pamh*, *int flags*);

## DESCRIPTION

The **pam\_chauthtok**() function attempts to change the authentication token for the user associated with the pam context specified by the *pamh* argument.

The *flags* argument is the binary or of zero or more of the following values:

- PAM\_SILENT

  Do not emit any messages.

- PAM\_CHANGE\_EXPIRED\_AUTHTOK

  Change only those authentication tokens that have expired.

If any other bits are set, **pam\_chauthtok**() will return PAM\_BAD\_CONSTANT.

## RETURN VALUES

The **pam\_chauthtok**() function returns one of the following values:

- \[PAM\_SUCCESS\]

  Success.

- \[PAM\_ABORT\]

  General failure.

- \[PAM\_AUTHTOK\_DISABLE\_AGING\]

  Authentication token aging disabled.

- \[PAM\_AUTHTOK\_ERR\]

  Authentication token failure.

- \[PAM\_AUTHTOK\_LOCK\_BUSY\]

  Authentication token lock busy.

- \[PAM\_AUTHTOK\_RECOVERY\_ERR\]

  Failed to recover old authentication token.

- \[PAM\_BAD\_CONSTANT\]

  Bad constant.

- \[PAM\_BUF\_ERR\]

  Memory buffer error.

- \[PAM\_CONV\_ERR\]

  Conversation failure.

- \[PAM\_PERM\_DENIED\]

  Permission denied.

- \[PAM\_SERVICE\_ERR\]

  Error in service module.

- \[PAM\_SYSTEM\_ERR\]

  System error.

- \[PAM\_TRY\_AGAIN\]

  Try again.

## SEE ALSO

[pam(3)](/pam/3.md), [pam\_strerror(3)](/pam_strerror/3.md)

## STANDARDS

*X/Open Single Sign-On Service (XSSO) - Pluggable Authentication Modules*, June 1997.

## AUTHORS

The **pam\_chauthtok**() function and this manual page were developed for the FreeBSD Project by ThinkSec AS and Network Associates Laboratories, the Security Research Division of Network Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 (“CBOSS”), as part of the DARPA CHATS research program.

The OpenPAM library is maintained by Dag-Erling Smørgrav ⟨*des@des.dev*⟩.
