Learn how to password protect your directories in the ACC.


In this video, we’re going to show you how to password protect your Account Control Center directories.

The first step is to connect via SSH. You can do this by opening up your computer’s command line program. This will be Terminal for Mac users and Command Prompt for Windows users.

I’m using Windows, so I will be opening up Command Prompt. Once you open the command line, you can log in to your Account Control Center by entering ssh username@username.pairserver.com. Replace both “username” with your Account Control Center username. It will ask you to enter you password for your account. Don’t worry if it doesn’t seem like the command line is registering your keystrokes – this is just a security measure. Type in the password like you usually would and then hit Enter.

When you have successfully logged in, a pair Networks welcome message will appear. You will be in your home directory. The next step is to create a password file in your home directory. We’re going to name our file “htpasswd,” but you can technically name it anything you want. To create the file enter: htpasswd -c passwd username.

Replace this username with the preferred username.

Only add -c after htpasswd if you do not already have a password file. If you already have a password file, and you run the command above, it will overwrite your current password file. If you are adding usernames to an existing password file, then the “-c” should be left off.

After running the command above, you will be prompted to enter the new password twice. The passwords you type will not be shown on the screen. You can add another username and password by entering the code again without the -c. Continue adding as many usernames and passwords as you like.

After you have finished creating the htpasswd file, exit the command line and log in to the Account Control Center.  In the left sidebar, click Files then navigate to the directory or subdirectory you would like to password protect.

If you have an .htaccess file in this directory, open it by clicking its name and then clicking Edit in the top navbar. If you do not have one, create one by clicking New File right here in the top navbar and naming the file “.htaccess” here in the text field.

Once you have opened the file, input this code:

AuthUserFile   /usr/home/username (replace this username with your ACC username)/passwd

AuthName “keyword” (replace this keyword with a short or descriptive word or phrase)

AuthType    Basic

require valid-user

The valid-user line allows anyone with a username & password found in your password file to have access to the directory. You can also choose to allow only certain users into the directory, by replacing that line with: require user user1 user2. Naturally, replace user, user1, and user2 with the usernames you created in the htpasswd file.

When finished, click Save Changes (or Create File if you are creating a new .htaccess file).

And that’s it. If you have any questions, check out our knowledgebase or contact our support team by support@pair.com.