htpasswd
What is a .htpasswd file?
text/plain
An .htpasswd file stores usernames and hashed passwords for HTTP Basic Authentication, one user per line as user:hash. The hash is typically bcrypt, Apache MD5 (apr1), or SHA, never plaintext. Apache and nginx read it to guard a directory or route.
How to use a .htpasswd file
Use an example .htpasswd to test Basic-Auth credential parsers, password-hash identification, and web-server auth configuration. The sample credentials are documented and for testing only.
Download example .htpasswd files
- htpasswd (HTTP Basic Auth)An Apache/nginx .htpasswd file with two users hashed using the {SHA} scheme (Base64 SHA-1): the sample passwords are documented in the file, for testing Basic-Auth credential parsers and hash identification.
- htpasswd (bcrypt): SAMPLESAMPLE htpasswd with a bcrypt hash line for Basic-auth file parsers.
- htpasswd (APR1 MD5): SAMPLESAMPLE htpasswd using Apache APR1 MD5-style hash for legacy Basic-auth tests.
- htpasswd (Mixed Algorithms): SAMPLEMulti-user SAMPLE htpasswd mixing bcrypt, APR1, and {SHA} lines for algorithm-detection tests.