Skip to content

Htpasswd Generator

Build an interactive Apache htpasswd bcrypt command without entering a password in the browser, shell arguments, Project Data, history, output, or URLs.

Choose your path

Built around the job you need to finish

Build one shell-quoted interactive Apache htpasswd bcrypt stdout command from a non-secret username and reviewed cost without accepting, hashing, printing or persisting a password in the browser.

Administrator creating one Basic-auth record

Use the official Apache utility without putting the password in browser state or command arguments.

Enter username/cost, copy the interactive command, run it in a trusted terminal and answer the hidden prompts.

The official utility produces the record while the page never sees the password.

Operator rotating an existing record

Avoid accidental file truncation and retain rollback.

Use stdout mode without `-c`, review the replacement record, back up/update through a controlled process and test rollback.

Only the intended entry changes and the credential file remains protected.

Security/accessibility reviewer

Decide whether Basic auth and the surrounding login flow are suitable.

Review TLS, scope, file permissions, lifecycle, monitoring, keyboard/error behavior and alternatives beyond the command.

A bcrypt record is not mistaken for end-to-end authentication safety.

Was this tool helpful?

Reference & details

How it works

Browser-free password handling

The page accepts only a username and bcrypt cost. It constructs `htpasswd -nB -C …` so the official Apache utility prompts for the password instead of exposing it in a browser field or command argument.

Bounded bcrypt planning

Apache documents bcrypt costs 4–17; this planner narrows the choice to 10–17 to respect current OWASP legacy-bcrypt guidance. The actual target server still needs benchmarking and compatibility verification.

Controlled file update

The `-n` command prints one record to stdout and does not edit a file. Review it, then use a controlled update with restrictive permissions; this page deliberately omits destructive `-c` and insecure plaintext/SHA-1 options.

Updated: August 2026

Example Scenarios

An administrator builds the command from a non-secret username, runs it in a trusted terminal, enters the password only at the hidden prompt, and reviews stdout before a controlled file update.

An operator avoids `-c`, creates a replacement record separately, backs up the protected file, updates one entry, tests access and rollback, then removes transient output.

A security reviewer records the command settings while separately checking HTTPS, authentication scope, file placement/permissions, credential lifecycle, accessibility, monitoring, and safer alternatives.

Common Mistakes to Avoid

Using SHA-1 or plaintext hash format

SHA-1 ({SHA}base64hash) has no salt and is trivially cracked with rainbow tables. Always use bcrypt ($2y$) or at minimum APR1 ($apr1$) which includes a random salt.

Storing htpasswd file within the web document root

The htpasswd file should be stored outside the publicly accessible directory tree. If exposed, attackers can download it and crack passwords offline.

FAQ

Apache bcrypt should be produced by the maintained official utility or an approved server library. The browser page avoids taking a password or reproducing a sensitive format with an unreviewed implementation.

Apache warns that `-b` places the plaintext password on the command line, where it may appear in process listings or shell history. The generated command prompts without a password argument.

Apache marks `{SHA}` SHA-1 as insecure, and raw MD5 hex is not Apache's modified MD5 record. This planner supports only interactive bcrypt and leaves legacy migration to an explicit reviewed process.

No. It prints a record to stdout. That makes review possible before a separate controlled update and avoids the destructive file-creation behavior of `-c`.

Install/version checks, HTTPS, Basic-auth scope, file location and permissions, backups, rotation, logging, incident response, accessible login/error behavior, and alternatives all require separate review.

About Htpasswd Generator

Plan one interactive bcrypt command for the official Apache htpasswd utility. No password field or browser-side hash is provided: the password belongs only in the trusted terminal's hidden prompt, while the Project receives settings and a credential-file warning.