htpasswd Generator
Create Apache .htpasswd entries for HTTP Basic Authentication
SHA-1 / MD5
Apache Ready
Client-Side
Note: For production use with bcrypt, use the command-line htpasswd tool.
—
How to Use .htpasswd
- Generate your htpasswd entry above
- Create a file named
.htpasswdon your server (outside the web root) - Paste the generated line into the file
- Add these lines to your
.htaccess:AuthType Basic AuthName "Restricted Area" AuthUserFile /path/to/.htpasswd Require valid-user
FAQ
.htpasswd is a flat-file used by Apache for HTTP Basic Authentication. Each line contains a username:hash pair. Combined with .htaccess directives, it restricts access to web directories.
HTTP Basic Authentication transmits credentials in Base64 (not encrypted) unless used with HTTPS. Always combine .htpasswd with SSL/TLS. For strong password hashing, use bcrypt via the server-side htpasswd command-line tool.