---
name: "passwd"
section: "1"
platform: "openbsd"
package: "man"
version: "8.0-current-20261101"
release: "OpenBSD 8.0-current (2026-11-01)"
platforms: ["linux", "freebsd", "openbsd", "macos"]
url: "https://new.carta.tech/passwd"
---

# passwd(1)

modify a user's password

## NAME

**passwd** – modify a user's password

## SYNOPSIS

**passwd** \[*user*\]

## DESCRIPTION

**passwd** changes the user's password. If no *user* is specified, the user's login name is used (see [logname(1)](/logname/1.md)). First, the user is prompted for their current password. If the current password is correctly typed, a new password is requested. The new password must be entered twice to avoid typing errors.

The new password should be at least six characters long and not purely alphabetic. A mixture of both lower and uppercase letters, numbers, and meta-characters is encouraged.

The quality of the password can be enforced by specifying an external checking program via the “passwordcheck” variable in [login.conf(5)](/login.conf/5.md).

The superuser is not required to provide a user's current password if only the local password is modified.

Password encryption parameters depend on the configuration of the “localcipher” capability in [login.conf(5)](/login.conf/5.md). If none is specified then blowfish is used, with the number of rounds selected based on system performance.

## FILES

- */etc/login.conf*

  configuration options

- */etc/master.passwd*

  user database

- */etc/passwd*

  user database, with confidential information removed

- */etc/passwd.XXXXXX*

  temporary copy of the password file

- */etc/ptmp*

  lock file for the passwd database

## DIAGNOSTICS

- Attempting to lock password file, please wait or press ^C to abort

  The password file is currently locked by another process; **passwd** will keep trying to lock the password file until it succeeds or you hit the interrupt character (control-C by default). If **passwd** is interrupted while trying to gain the lock, the password change will be lost.

  If the process holding the lock was prematurely terminated, the lock file may be stale and **passwd** will wait forever trying to lock the password file. To determine whether a live process is actually holding the lock, the admin may run the following:

  ```
  $ fstat /etc/ptmp
  ```

  If no process is listed, it is safe to remove the */etc/ptmp* file to clear the error.

## SEE ALSO

[chpass(1)](/chpass/1.md), [encrypt(1)](/encrypt/1.md), [logname(1)](/logname/1.md), [login.conf(5)](/login.conf/5.md), [passwd(5)](/passwd/5.md), [pwd\_mkdb(8)](/pwd_mkdb/8.md), [vipw(8)](/vipw/8.md) Robert Morris and Ken Thompson, “Password security: a case history”, *Communications of the ACM*, Volume 22, Issue 11, pp. 594–597, Nov. 1979.

## HISTORY

A **passwd** command appeared in Version 3 AT&T UNIX.
