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!

Multiple passwords for protected directory?

Discussion in 'Security' started by James Donnelly, Jan 28, 2005.

  1. James Donnelly

    James Donnelly Registered

    Jan 28, 2005
    Likes Received:
    Trophy Points:
    I'd like to set up a password system allowing each user accessing a protected section of a website to have their own unique password. I'd like to have them access the directory with an initial "administrator provided" password, then be prompted to change the password to one of their own (like a typical network user account).

    I'd also like to be able to use a login form on a static webpage to allow users entry into the password protected section.

    My questions are (1) is there way to give the password protection feature found in cPanel the expanded ability for multiple user/password creation for the same directory (either from cPanel or 3rd party solution) and (2) is there a way to point a form (what "action=?") somewhere so that a static form can be used in place of the browser generated login panel?
  2. bijo

    bijo Well-Known Member

    Aug 21, 2004
    Likes Received:
    Trophy Points:
    Hi James,

    With the help of a .htaccess file you can do it.. I pasted a sample .htaccess file below. And place the .htaccess file in to the particular directory.

    cat .htaccess

    AuthType Basic
    AuthName "Restricted Area"
    AuthUserFile "/home/xxxx/.htpassword/password"
    require valid-user

    Then save the file.
    Then run the command
    htpasswd -c /home/xxxx/.htpassword/password <username>
    (-c is used for creating the file.(nest time it don't need))

    With the help of this command you can add users to the particular file.

    I am not sure about your second question.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

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