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.

Multiple passwords for protected directory?

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

  1. James Donnelly

    James Donnelly Registered

    Joined:
    Jan 28, 2005
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    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

    Joined:
    Aug 21, 2004
    Messages:
    475
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    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.
     
Loading...

Share This Page