Helper when htpasswd is not available
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-29 18:39:49 +02:00
bin fix usage message 2026-08-29 18:39:49 +02:00
README.md add readme 2026-08-29 18:39:49 +02:00

htpass

Prints an htpasswd line for a user, without needing the apache2-utils / apache-tools package installed.

Installation

tpm install htpass

Usage

htpass alice                      # asks for the password, prints the line
htpass alice >> .htpasswd         # append to an existing file

Output looks like:

alice:$6$Xy...$...

Notes

  • The password is asked interactively (twice) by openssl passwd, so it never ends up in the shell history.
  • The hash is SHA-512 crypt (openssl passwd -6), understood by nginx and Apache basic auth.