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

# pam\_unix(8)

UNIX PAM module

## NAME

**pam\_unix** – UNIX PAM module

## SYNOPSIS

\[*service-name*\] *module-type* *control-flag* *pam\_unix* \[*options*\]

## DESCRIPTION

The UNIX authentication service module for PAM, **pam\_unix** provides functionality for three PAM categories: authentication, account management, and password management. In terms of the *module-type* parameter, they are the “auth”, “account”, and “password” features. It also provides a null function for session management.

### Ux Ss Authentication Module

The UNIX authentication component provides functions to verify the identity of a user (**pam\_sm\_authenticate**()), which obtains the relevant [passwd(5)](/passwd/5.md) entry. It prompts the user for a password and verifies that this is correct with [crypt(3)](/crypt/3.md).

The following options may be passed to the authentication module:

- **debug**

  [syslog(3)](/syslog/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.

- **auth\_as\_self**

  This option will require the user to authenticate themselves as themselves, not as the account they are attempting to access. This is primarily for services like [su(1)](/su/1.md), where the user's ability to retype their own password might be deemed sufficient.

- **nullok**

  If the password database has no password for the entity being authenticated, then this option will forgo password prompting, and silently allow authentication to succeed.

  **NOTE:** If **pam\_unix** is invoked by a process that does not have the privileges required to access the password database (in most cases, this means root privileges), the **nullok** option may cause **pam\_unix** to allow any user to log in with any password.

- **emptyok**

  If the password database contains the password for the entity being authenticated, but the password matches an empty string, then this option will forgo password prompting, and silently allow authentication to succeed.

  The difference between this and **nullok** is that it avoids prompting for password when the password is set to an empty string, as opposed to not being set.

- **local\_pass**

  Use only the local password database, even if NIS is in use. This will cause an authentication failure if the system is configured to only use NIS.

- **nis\_pass**

  Use only the NIS password database. This will cause an authentication failure if the system is not configured to use NIS.

### Ux Ss Account Management Module

The UNIX account management component provides a function to perform account management, **pam\_sm\_acct\_mgmt**(). The function verifies that the authenticated user is allowed to log into the local user account by checking the following criteria:

- locked status of the account compatible with [pw(8)](/pw/8.md) **lock**;

- the password expiry date from [passwd(5)](/passwd/5.md);

- [login.conf(5)](/login.conf/5.md) restrictions on the remote host, login time, and tty.

The following options may be passed to the management module:

- **debug**

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

### Ux Ss Password Management Module

The UNIX password management component provides a function to perform password management, **pam\_sm\_chauthtok**(). The function changes the user's password.

The following options may be passed to the password module:

- **debug**

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

- **no\_warn**

  suppress warning messages to the user. These messages include reasons why the user's authentication attempt was declined.

- **local\_pass**

  forces the password module to change a local password in favour of a NIS one.

- **nis\_pass**

  forces the password module to change a NIS password in favour of a local one.

## FILES

- */etc/master.passwd*

  default UNIX password database.

## SEE ALSO

[passwd(1)](/passwd/1.md), [getlogin(2)](/getlogin/2.md), [crypt(3)](/crypt/3.md), [getpwent(3)](/getpwent/3.md), [pam(3)](/pam/3.md), [syslog(3)](/syslog/3.md), [nsswitch.conf(5)](/nsswitch.conf/5.md), [passwd(5)](/passwd/5.md), [pw(8)](/pw/8.md), [yp(8)](/yp/8.md)

## BUGS

The **pam\_unix** module ignores the PAM\_CHANGE\_EXPIRED\_AUTHTOK flag.
