To password protect a directory, do the following:
-
Sign in to Virtualmin.
-
Click Services in the left-hand navigation, then click Protected Directories.
-
Click Add protection for a new directory.
-
Under Website subdirectory, pick an option that suits you needs. Whatever you use for Sub-directory will be relative to your virtual server's document root (web/public).
-
Under Authentication realm, enter anything to 'name' the protected resource. The realm is simply a description for the password-protected directory, which is displayed in the users' browsers when they try to login. You can enter anything, such as Private files or Database access.
-
Click Create. You should now see a listing of your protected directories.
This defined the protected realm. To assign access to users:
-
Click Services in the left-hand navigation, then click Edit FTP Users (the option might also be called Edit Mail and FTPUsers depending on the features you used).
-
Pick an existing user, or create a new one.
-
Open up the Other user permissions section.
-
Select the protection realm name that you create above under Allow access to web directories and click the right arrow button to give access to this user.
-
Click Save.
You've now password protected a directory and assigned a user to this protected area. If you want, you can go back and add more users by repeating the last four steps.