Support / KnowledgeBase

 
Search the KnowledgeBase Search

Password protecting directories

  • Applies to: (gs)

  • Difficulty: Easy

  • Time needed: 15 minutes

  • Tools needed: ssh

 

NOTE:

The following assumes you have already created the directory you wish to password protect. If you have not you will need to create it via FTP or using the File Manager in your GridControls.


Text in this color is used as an example. Please be sure to replace this text with the proper information for your server or domain. 

Password Protect Directory via the AccountCenter

Create your Web Users

  1. Login to your AccountCenter
  2. Click on Password Protect Folders
    ppfolders
  3. Click on Add a new web user
    addwebuser
  4. Create a Username and Password.

    NOTE:

    This user only applies to your password-protected folders. You may also assign a user to a group if one has already been created.


    webusersettings
  5. Click Save and continue on to create a Web User Group and Protected Folders.

Create your Web User Groups

  1. Click on Add a new web group
    addwebgroup
  2. Choose your Settings:
    webgroupsettings_1
    • Group Name: Name for this web group.
    • Web User Group Membership: The web users that belong to this group. 
  3. Click Save and continue on to create Protected Folders.

Create your Protected Folders

  1. Click on Protect a new folder
    protectnewfolder
  2. Choose your settings
    protectwebfoldersetttings
    • Folder: Choose the path you wish to protect
    • Description: The description displayed to users when prompted for authentication, such as "VIP Client Restricted Area"
    • Group Access: Select the Group(s) that can access this folder.
    • User Access: Select the User(s) that can access this folder.


Password Protect a Directory via SSH 

This details how to use SSH to password protect web directories for (gs) Grid-Services. To proceed with these instructions you only need SSH and FTP access enabled for your serveradmin user. 

  1. Log into your (gs) Grid-Service with the username serveradmin@mt-example.com.  If you need help with this step please refer to our KnowledgeBase article: Connecting via SSH to your (gs) Grid-Service
  2. Navigate to the html directory for the domain you'd like to protect. The command will look something like:

    cd /home/#####/domains/mt-example.com/html
  3. Use the htpasswd command to create a username and password that will be used to log into the directory you would like to protect. This username and password will be requested via a pop-up dialog box when users enter the protected directory. The command you'll need to use will look like this:

    htpasswd -c .htpasswd username
  4. Follow the prompts and enter the password for this new user twice.
  5. Create a .htaccess file with the following contents:

    AuthUserFile /home/#####/domains/mt-example.com/html/.htpasswd
    AuthGroupFile /dev/null
    AuthName "Authentication Pop Up"
    AuthType Basic
    <LIMIT POST GET>
    require user username
    </LIMIT> 
  6. Now simply move the file to the directory you desire to password protect.

 

Revisions:

10-02-2008: Article Rewrite

User Comments

No visitor comments posted. Post a comment

Fields marked with an asterisk(*) are required. Comment on this article

Fill out the form below if you would like to comment on this article.
 
 
 

(code is not case-sensitive)
 
Submit
 
 

Continue