The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

.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:
    6
    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!
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,448
    Likes Received:
    194
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
  3. brianjking

    brianjking Active Member

    Joined:
    Sep 15, 2009
    Messages:
    35
    Likes Received:
    1
    Trophy Points:
    6
    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).
     
  4. brianjking

    brianjking Active Member

    Joined:
    Sep 15, 2009
    Messages:
    35
    Likes Received:
    1
    Trophy Points:
    6
    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
    .
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,696
    Likes Received:
    656
    Trophy Points:
    113
    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.
     
  6. brianjking

    brianjking Active Member

    Joined:
    Sep 15, 2009
    Messages:
    35
    Likes Received:
    1
    Trophy Points:
    6
    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.
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,696
    Likes Received:
    656
    Trophy Points:
    113
    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.
     
Loading...

Share This Page