How to password protect a directory on your dedicated server
Password protecting a website or directory is a very simple method of securing the folder. Please follow the instructions below to password protect a directory.
1. Log into your dedicated server via RDP.
2. Make sure the directory that you want to password protect is below the directory your domain is pointed at.
3. Right click on the directory that you wish to password protect and click on properties.
4. Click on the security tab
5. Click on the advanced button and then click change permissions.
6. Make sure both boxes on this are unchecked or your permissions will not work correctly. Click apply and then click add when it asks you if you want to remove all inherited permissions. We do not want to remove all of them. Click ok on the next screen.
7. From here you will need to remove any users that either have IIS in them or IUSR. Make sure that you still have the administrators allowed as well as the users you wish to have access to it (example). Give them all but full access as in the example below.
8. Click apply.
9. Once permissions have been applied to the directory, open up IIS Manager. This can be found in the start menu under the 'Administrative Tools' section.
10. In IIS Manager, expand the list of sites and click on the site which points to the directory you want to password protect. Click on the + sign next to the IIS entry for the site to see a list of directories. Navigate to the directory you wish to password protect and highlight that directory.
11. In the list of option on the main middle panel, choose 'Authentication' from the list of options under the 'IIS' heading. It should be the second icon in the list. There are 2 permissions settings that need to be changed. You can enable or disable them from the menu on the far right.
- Anonymous Authentication - Disabled
- Windows Authentication - Enabled
- All other authentication methods listed should be 'Disabled' as well.
12. Close IIS manager and test the site. It should ask for a username and password when attempting to access the directory.