Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Password protect site

Discussion in 'Security' started by GloryDays, Dec 3, 2018.

  1. GloryDays

    GloryDays Member

    Joined:
    Aug 15, 2018
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,877
    Likes Received:
    482
    Trophy Points:
    583
    Location:
    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!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. GloryDays

    GloryDays Member

    Joined:
    Aug 15, 2018
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    van nuys, ca
    cPanel Access Level:
    Root Administrator
    I don't think that did anything. I went to the domain and there is no popup or anything asking for login. Am I supposed to see a folder under public_html where I created that new directory?
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,877
    Likes Received:
    482
    Trophy Points:
    583
    Location:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. GloryDays

    GloryDays Member

    Joined:
    Aug 15, 2018
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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 :)
     
  6. Infopro

    Infopro cPanel Sr. Product Evangelist Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,877
    Likes Received:
    482
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. rpvw

    rpvw Well-Known Member

    Joined:
    Jul 18, 2013
    Messages:
    1,088
    Likes Received:
    442
    Trophy Points:
    113
    Location:
    Spain
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    Infopro likes this.
  8. Infopro

    Infopro cPanel Sr. Product Evangelist Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,877
    Likes Received:
    482
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Absolutely, not me. :P
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. GloryDays

    GloryDays Member

    Joined:
    Aug 15, 2018
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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
     
  10. Infopro

    Infopro cPanel Sr. Product Evangelist Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,877
    Likes Received:
    482
    Trophy Points:
    583
    Location:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. DemonMaestro

    DemonMaestro Member

    Joined:
    Nov 30, 2018
    Messages:
    16
    Likes Received:
    4
    Trophy Points:
    78
    Location:
    Texas
    cPanel Access Level:
    Root Administrator
    @GloryDays instead of typing a password. Try the generator just to make sure its not a different problem.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice