HtPasswd Generator

How can I generate a htpasswd file?

Use this htpasswd generator to create passwords for htpasswd files. Create a htaccess string using your username and password. Simply fill in the form below.

What is a htpasswd file?

A '.htpasswd' file is a file which will protect your directory on a web server. This will only work on apache. Simply create a '.htpasswd' file in the directory you wish to secure, and copy the htpasswd string you generated. Htpasswd files are used to create and update password protected directories on your web server. This is also known as 'basic authentication'.

How can I secure a directory on my server or website with a username and password?

Simply copy the htpasswd string into a '.htpasswd' file. If you require multiple username and passwords, just copy one per line.

The second step is to enable this password by adding the following to a '.htaccess' file within the directory you wish to secure.

AuthType Basic
AuthName "Type whatever you want here. Note: Members of the public can view it :-)"
AuthUserFile /var/www/.htpasswd # edit this to the location of your .htpasswd file
Require valid-user