This tutorial covers how to password protect a directory within a website. Users browsing to that directory in a web browser will be prompted for a password prior to being able to view it's contents.
It assumes you have first logged into Virtualmin.
-
Choose the domain you would like to add the protected directory account to. You can do that by selecting the domain name from the drop-down box on the top-left.
-
Click
Services
. -
Click
Protected Directories
. -
Choose whether the password protection should be for the entire website, a sub-directory, or part of cgi-bin.
If you choose a sub-directory or cgi-bin, enter the directory name you are protecting, relative to public_html or cgi-bin. For example, if the password protection should be on
https://example.com/secret/
, then entersecret
into the textbox. -
Enter the
Authentication Realm
. This is the text that the user will see when being prompted for a password. -
Click
Create
-
Now go into 'Edit Users' -> USERNAME -> Other User Permissions
-
In the selectbox next to
Allow access to web directories
, select the directories this user should have permission to access.