htpasswd(1)

htpasswd1

Create and update user authentication files

Usage

htpasswd [file] login

htpasswd -I [file]

Overview

htpasswd is used to create and update user authentication files for HTTP daemons.

The options are as follows:

-I

Switch to batch mode. htpasswd reads exactly one line from standard input and splits it at the first ":". The first part is the login, the second part is the password which htpasswd then hashes using bcrypt(3).

htpasswd prompts for a password and generates a hash using bcrypt(3). A line suitable for a password file is written to the standard output. If invoked with two arguments( or one argument if the -I flag is used), user authentication file is updated.

Releases

56 releases since OpenBSD 2.6; the text changed 14 times.

  1. 2.6
  2. 2.7–2.8
  3. 2.9–3.0
  4. 3.1–3.3
  5. 3.4–3.5
  6. 3.6
  7. 3.7
  8. 3.8–4.1
  9. 4.2–4.3
  10. 4.4–4.8
  11. 4.9–5.5
  12. 5.6
  13. 5.7–6.1
  14. 6.2–7.0
  15. 7.1–8.0

-I since OpenBSD 5.6.

-b until OpenBSD 5.5; -c until OpenBSD 5.5; -d until OpenBSD 5.5; -l until OpenBSD 5.5; -m until OpenBSD 5.5; -n until OpenBSD 5.5; -p until OpenBSD 5.5; -s until OpenBSD 5.5.

History

This reimplemented version of htpasswd has been available since OpenBSD 5.6.

Authors

Florian Obser ⟨[email protected]⟩ implemented htpasswd from scratch after Apache httpd was removed from OpenBSD base.

From man 8.0-current-20261101 in OpenBSD 8.0-current (2026-11-01). Parsed by carta from the page's mdoc source.