---
name: "pam_chauthtok"
section: "3"
platform: "linux"
package: "pam"
version: "1.7.3-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/pam_chauthtok"
---

# pam\_chauthtok(3)

updating authentication tokens

## NAME

pam\_chauthtok - updating authentication tokens

## SYNOPSIS

```
#include <security/pam_appl.h>
```

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

## DESCRIPTION

The **pam\_chauthtok** function is used to change the authentication token for a given user (as indicated by the state associated with the handle *pamh*).

The *pamh* argument is an authentication handle obtained by a prior call to pam\_start(). 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

This argument indicates to the modules that the user's authentication token (password) should only be changed if it has expired. If this argument is not passed, the application requires that all authentication tokens are to be changed.

## RETURN VALUES

PAM\_AUTHTOK\_ERR

A module was unable to obtain the new authentication token.

PAM\_AUTHTOK\_RECOVERY\_ERR

A module was unable to obtain the old authentication token.

PAM\_AUTHTOK\_LOCK\_BUSY

One or more of the modules was unable to change the authentication token since it is currently locked.

PAM\_AUTHTOK\_DISABLE\_AGING

Authentication token aging has been disabled for at least one of the modules.

PAM\_PERM\_DENIED

Permission denied.

PAM\_SUCCESS

The authentication token was successfully updated.

PAM\_TRY\_AGAIN

Not all of the modules were in a position to update the authentication token(s). In such a case none of the user's authentication tokens are updated.

PAM\_USER\_UNKNOWN

User unknown to password service.

## SEE ALSO

[**pam\_start**(3)](/pam_start/3.md), [**pam\_authenticate**(3)](/pam_authenticate/3.md), [**pam\_setcred**(3)](/pam_setcred/3.md), [**pam\_get\_item**(3)](/pam_get_item/3.md), [**pam\_strerror**(3)](/pam_strerror/3.md), [**pam**(8)](/pam/8.md)
