Protect directory with username and password

 To protect a folder with an password prompt, you only need to place a .htaccess and a .htpasswd into the target directory.



The passwort can be crypted via crypt or MD5.

On you can find a useful hash generator.

If you have a linux shell you can use:

Or you can use this little Python script I’ve written:

You can also download it here:

Attention!: You need to install the Python tk package to run the script. On Debian or Ubuntu you can do this with the following command:

More Excamples

Allow all image requests

For example, if you wish to use images in an test email.

Allow special paths

Attention: This denies all other paths.

More information

2 thoughts on “Protect directory with username and password

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.