Changes between Version 3 and Version 4 of faq/security/password-protect-directory
- Timestamp:
- Mar 18, 2009, 9:50:15 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
faq/security/password-protect-directory
v3 v4 7 7 In this example, we have multiple translators that need to access video files they need to translate (Dan and Nancy). Both translators will have their own username and password. In addition, both translators will be able to access all protected files. 8 8 9 1. Use [wiki:sftp SFTP] to login to your web site. Go to {{{<yourdomain>.org/web}}} and create a new directory (AKA folder) called "translations". This will be the web page that you put your files onto, and that the users log onto and download the files.10 1. Use [wiki:secure_shell secure shell] to login to your account.11 1. Create a username and password for a translator (in this example, Dan) so that he can log onto the translations page. His user name will simply be "dan". Type:9 1. If you already have a folder in place (or if you are protecting your entire web site) you can skip this step. On the other hand, if you only want to protect a single folder and you haven't create it yet: Use [wiki:sftp SFTP] to login to your web site. Go to {{{<yourdomain>.org/web}}} and create a new directory (AKA folder) called "translations". This will be the web page that you put your files onto, and that the users log onto and download the files. 10 1. Next, use [wiki:secure_shell secure shell] to login to your account. 11 1. Create a username and password (in this example, the username is dan) so that he can access the protected directory. His user name will simply be "dan". Type the following (you will be prompted to create a password after you type each command): 12 12 {{{ 13 htpasswd -c ~/ yourdomain.org/include/htpasswd_translationsdan13 htpasswd -c ~/YOUR-DOMAIN-NAME/include/htpasswd dan 14 14 }}} 15 1. Give Nancy a separate username to log onto the same translations page. Her username will simply be "nancy". Type:15 1. Optionally, give Nancy a separate username to log onto the same directory. Her username will simply be "nancy". Type: 16 16 {{{ 17 htpasswd ~/ yourdomain.org/include/htpasswd_translationsnancy17 htpasswd ~/YOUR-DOMAIN-NAME/include/htpasswd nancy 18 18 }}} 19 19 1. It's a good idea to attach a user for yourself as well so you can login and make sure things are working. 20 20 {{{ 21 htpasswd ~/ yourdomain.org/include/htpasswd_translations <my username>21 htpasswd ~/YOUR-DOMAIN-NAME/include/htpasswd YOUR-USERNAME 22 22 }}} 23 1. Finally, login to your Members Control Panel, select "Web Config" from the services drop down menu. Add the following in the text field next to 'settings'. What you see that is in capital letters is what you have to insert for your own specifics outside of this example. 23 1. Finally, login to your Members Control Panel, select "Web Config" from the services drop down menu. Add the following in the text field next to 'settings'. What you see that is in capital letters is what you have to insert for your own specifics outside of this example. If you are protecting your entire web site, just enter a forward slash (/) in the Location part. 24 24 {{{ 25 <Location / translations>25 <Location /FOLDER-TO-PROTECT> 26 26 AuthType Basic 27 27 AuthName "username" 28 AuthUserFile /home/members/GROUPNAME/sites/YOUR DOMAINNAME/include/htpasswd_translations28 AuthUserFile /home/members/GROUPNAME/sites/YOUR-DOMAIN-NAME/include/htpasswd 29 29 require valid-user 30 30 </Location> … … 32 32 1. Cick the submit button, wait a few seconds and then click the refresh button 33 33 34 Test the setup by going to !http://yourdomain.org/translations. 35 36 You should be prompted for a username and password. 34 Now, when you go to the directory via a web page, you should be prompted for a username and password. 37 35 38 36 Enter any of the three username/password combos you created above.