GloryDays

Member
Aug 15, 2018
6
0
1
van nuys, ca
cPanel Access Level
Root Administrator
Hello,

Is there a tutorial somewhere on how to do the most basic password protection for a website. Sorry I know only enough to be dangerous so I don't know the difference between protecting the directories and a website (which is what I found when I searched for this topic. We have multiple sites. I need just one of them to be accessible only via a log in. I know there is a place to add a password on the "list accounts" page, but I'm not sure what that password is for. We don't remote host websites for anyone, I was thinking that is what that is for?
thanks
 

Infopro

Well-Known Member
May 20, 2003
17,113
507
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
In your cPanel > Files > Directory Privacy > assuming you're in the public_html/ "folder", and you have for example, a website setup in another directory called blog, and you see it there in public_html, you'd click the name (not the icon beside it), blog, to enter the options for what you seek. There, create a user, first, and give him a password. Next, tick the box there to, Password Protect This Directory. Then type in a message for the name part, this can be most anything you like really, KEEP OUT, for example.

Click save. HTH!
 

Infopro

Well-Known Member
May 20, 2003
17,113
507
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
On the main Directory Privacy page, do you see a lock icon to the left of the directory name that you locked down?

If yes, you might want to restart your browser (or try another browser) and then try to access that directory again to get the login prompt.

Side note: assuming you have root access to the server, you should make sure you've whitelisted your IP address to prevent getting locked out if you typo the login details.
 

GloryDays

Member
Aug 15, 2018
6
0
1
van nuys, ca
cPanel Access Level
Root Administrator
It does not have a lock icon but when I click on the public_html folder it shows the authorized user I created at the bottom. I even tried deleting it and trying again but it still doesn't have the lock icon. Closed and started a different browser. I guess I have root access but I don't know what "whitelisting your IP address" means. I am obviously a basic user, kind of thrown into this by my boss, we have no IT person or web designer, I know only enough to be dangerous. Thank you for your help, just pretend you are explaining it to your grandma :)
 

Infopro

Well-Known Member
May 20, 2003
17,113
507
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
Thank you for your help, just pretend you are explaining it to your grandma
I did, in my first post above. :)
Please check your steps again following that post. If you follow it to the letter, you'd be seeing that lock I mention. It looks like this:

bluelock.png

I password protected a directory inside the public_html directory called, "testingthis".

I'm going to assume here that you do not have root access. If you're unsure about who your Hosting Provider is, you might want to speak with your boss and find out, just so you know who to contact IF you get locked out using an incorrect password.
 

rpvw

Well-Known Member
Jul 18, 2013
1,088
446
113
UK
cPanel Access Level
Root Administrator
I'm not sure if it's @Infopro doing the voice-over ......... but this might help


cPanelTV is your friend :-D
 
  • Like
Reactions: Infopro

GloryDays

Member
Aug 15, 2018
6
0
1
van nuys, ca
cPanel Access Level
Root Administrator
OK I got it. You have to click on the FOLDER for public_html first to go in it, THEN click the NAME "public_html" and create the rest. It works now but isn't taking the password. :( nothing is ever easy
 

Infopro

Well-Known Member
May 20, 2003
17,113
507
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
In cPanel, as you'll soon realize, I'm sure, most everything is very easy. Trust me on this. :)

Assuming you did not get locked out, go back in and set an easy password, if you're permitted to by your Hosting Provider, just to get an idea of what you're doing here. Then, set a strong password and be sure not to copy paste it, type it in.

Copy/Paste can sometimes lead to spaces before or after, and that makes your password incorrect, of course.