Having a domain means you can share many things with the world. But sometimes you don’t want the world to see everything. Your cpanel provides a tool that can put a username/password lock on any directory in your site files.

Before adding a password, the Mad Scientists at Extend Labs need to put something on their web site to protect. Returning to what they learned earlier for using the File Manager to add a set of web files, from within their cpanel, they open the File Manager.

They remember that the public_html directory contains all content that shows up at their main domain url extendlabs.ca and that they already have a directory in there named stuff, Navigating to that directory, they create a new folder within there called dropped intended for some files they want to store but keep under password protection. They upload a few files, an image, a PDF, and an mp3 audio file.

For now, anyone can see these files via the URL http://extendlabs.ca/stuff/dropped.

Now the Mad Scientists are ready to put a lock and key on that URL. From their cpanel, in the Files group, they open Directory Privacy. This reveals a list of all directories in their domain.

Clicking the folder icon next to public_html opens a list of directories in there, they once more use the folder icon to open the one for stuff. In this listing, the click the text for the name of the directory to be protected, dropped. Now we are ready to put that lock on this.

Click the box for password protect this directory. The top portion of this editor includes a field to put a description of the directory used to display on the login box.

This is optional, but may help a visitor you sent here know what they are trying to access. Click Save. Below this, they enter a username and a password that is used to access this directory (make sure you keep track of this information to you can share it). Click Save again.

If you return to this same URL http://extendlabs.ca/stuff/dropped instead of seeing the contents, you are presented a login box. Without the username and password… you cannot see what is inside.

If you ever need to remove the protection, navigate back the same way, uncheck the box for password protect this directory and click Save. To change the password of a user, enter the same username and the new password in the lower section, and then Save.

You might use Directory Privacy just for a set of files, but it can also be done for an entire web directory, just see if you can get your way into http://extendlabs.ca/notme/.

Example for "Password Protecting Part of Your Domain":
http://extendlabs.ca/stuff/dropped

Complete This Activity

After you do this activity, please share it so it can appear with other responses below. If your response exists at a public viewable URL, you can add the information directly to this site.

Add A Response

2 Responses Completed for this Activity

  • Password Please (Irene Stewart, @IrenequStewart)

    If you want in my private folder, you will need to supply the correct password. Actually, this one took a couple of tries. Not sure what I was doing wrong so I just deleted everything and used the traditional Windows Error hack: I shut everything down and started over from scratch!

  • Do NOT Enter (Lisa Koster, @lkoster)

    Adding security to a site is great if you want to share files/pictures/webpages with a few people, but not the world. I would imagine it’s only as safe as the password you use..but if definitely keeps out the majority of people who you may not want to see certain files. Again – you can use… Read more »

Creative Commons License
This work by Alan Levine is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Leave a Reply

Your email address will not be published. Required fields are marked *