Changes between Version 3 and Version 4 of faq/security/password-protect-directory


Ignore:
Timestamp:
Mar 18, 2009, 9:50:15 PM (16 years ago)
Author:
Jamie McClelland
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • faq/security/password-protect-directory

    v3 v4  
    77In 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.
    88
    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):
    1212{{{
    13 htpasswd -c ~/yourdomain.org/include/htpasswd_translations dan
     13htpasswd -c ~/YOUR-DOMAIN-NAME/include/htpasswd dan
    1414}}}
    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:
    1616{{{
    17 htpasswd ~/yourdomain.org/include/htpasswd_translations nancy
     17htpasswd ~/YOUR-DOMAIN-NAME/include/htpasswd nancy
    1818}}}
    1919 1. It's a good idea to attach a user for yourself as well so you can login and make sure things are working.
    2020{{{
    21 htpasswd ~/yourdomain.org/include/htpasswd_translations <my username>
     21htpasswd ~/YOUR-DOMAIN-NAME/include/htpasswd YOUR-USERNAME
    2222}}}
    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.
    2424{{{
    25 <Location /translations>
     25<Location /FOLDER-TO-PROTECT>
    2626 AuthType Basic         
    2727 AuthName "username"
    28  AuthUserFile /home/members/GROUPNAME/sites/YOURDOMAINNAME/include/htpasswd_translations
     28 AuthUserFile /home/members/GROUPNAME/sites/YOUR-DOMAIN-NAME/include/htpasswd
    2929 require valid-user                                                         
    3030</Location>
     
    3232 1. Cick the submit button, wait a few seconds and then click the refresh button
    3333
    34 Test the setup by going to !http://yourdomain.org/translations.
    35 
    36 You should be prompted for a username and password.
     34Now, when you go to the directory via a web page, you should be prompted for a username and password.
    3735
    3836Enter any of the three username/password combos you created above.