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!

.htaccess authentication via domains email account usernames & passwords

Discussion in 'General Discussion' started by brianjking, Jan 11, 2016.

  1. brianjking

    brianjking Active Member

    Joined:
    Sep 15, 2009
    Messages:
    35
    Likes Received:
    1
    Trophy Points:
    58
    Location:
    Chicago, IL
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    I have an issue that I'm trying to sort in a relatively easy way. I hope my explanation below is helpful!

    • site.com
      • Main company website
      • Employee email accounts
    • training-for-site.com
      • Static MkDocs/Sphinx built documentation/training materials (html/css files) that are private for people who WORK FOR site.com
    Currently, we just have one login using .htaccess for training-for-site.com that we change the password for if a team member is terminated or quits and then re-distribute the login to the remaining team members.

    However, what I'd like to have is the .htaccess file for training-for-site.com authenticate against email addresses and passwords for site.com.

    Both site.com and training-for-site.com are both hosted on the same cPanel server.

    Any idea if this is possible?

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,309
    Likes Received:
    393
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. brianjking

    brianjking Active Member

    Joined:
    Sep 15, 2009
    Messages:
    35
    Likes Received:
    1
    Trophy Points:
    58
    Location:
    Chicago, IL
    cPanel Access Level:
    Root Administrator
    Twitter:
    No, I don't believe this would work. I'm not giving them access to edit the files, but specifically view content via a web browser hosted at training-for-site.com (based on original example).
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. brianjking

    brianjking Active Member

    Joined:
    Sep 15, 2009
    Messages:
    35
    Likes Received:
    1
    Trophy Points:
    58
    Location:
    Chicago, IL
    cPanel Access Level:
    Root Administrator
    Twitter:
    It looks like the passwords are hashed for site.com in
    Code:
    /home/site.com/etc/shadow
    .
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,323
    Likes Received:
    1,851
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello :)

    You could create multiple users and force authentication to a specific URL via the "Password Protect Directories" feature (named "Directory Privacy" in the Paper Lantern theme) in cPanel:

    Password Protect Directories - Documentation - cPanel Documentation

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. brianjking

    brianjking Active Member

    Joined:
    Sep 15, 2009
    Messages:
    35
    Likes Received:
    1
    Trophy Points:
    58
    Location:
    Chicago, IL
    cPanel Access Level:
    Root Administrator
    Twitter:

    I already do this. What I'm attempting to do is not have to make users a second time nor making the users remember a second username and password.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,323
    Likes Received:
    1,851
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    There are no native features in cPanel/WHM that will allow you to combine/manage the "Password Protect Directories" feature for multiple cPanel accounts. However, you could develop a custom script that copies the contents of the /home/$username/.htpasswd file into the same location for the additional account at set times.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
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