+ Reply to Thread
Results 1 to 2 of 2

Thread: How can I use a list of names in CPanel to create password protected folders?

  1. #1
    Avery Sloan is offline New Bee
    Join Date
    Mar 2011
    Posts
    2
    WHB Points this Month
    0.00
    WHB Points
    0.00
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How can I use a list of names in CPanel to create password protected folders?

    Hello! I am new to WebhostingBuzz and logged onto CPanel today to test the Password Protect feature. I works fine and I downloaded the "passwd" file to take a loot at it and most of the entry is scrambled.

    Is there a way to upload a list of users and passwords? I have over 400 user names and it will be very time consuming to go online and type each on individually to create unique user names and passwords.

    Thanks for any suggestions or alternate methods of accomplishing this task!

  2. #2
    Maxim M.'s Avatar
    Maxim M. is offline WeeHBie
    Join Date
    Sep 2008
    Location
    Kharkiv, UA
    Posts
    545
    Servers
    webhostingbuzz.com
    WHB Points this Month
    5.00
    WHB Points
    55.00
    Thanks
    14
    Thanked 3 Times in 3 Posts

    Default

    Hello,

    You can use the htpasswd utility via SSH in order to add a user/password combination to a passwd file using commands like this:

    htpasswd -b -c .htpasswd user1 password1 {creates the file}
    htpasswd -b .htpasswd user2 password2 {modifies the existing file}


    It will create unique passwords for user1 and user2 with MD5 encryption:

    user1:3ZRwflCiReE.2
    user2:.Mkl9Av4.FjsY


    You can then put a .htaccess file to the protected folder and point it to the newly created .htpasswd:

    AuthType Basic
    AuthName "name"
    AuthUserFile /home/username/.htpasswd
    require valid-user


    Note that .htaccess applies to all sub-directories of the folder it is in.
    Maxim M.
    Customer Service Manager
    WebHostingBuzz.com

    Join our FaceBook community for the useful info and latest promotions.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts