Solved

Perl Password protection

Posted on 1999-01-21
4
152 Views
Last Modified: 2010-03-05
I need a program to ask users for a password so they can load an html page. Something like the Experts-exchange have, to ask their user passwords.
0
Comment
Question by:jcao
  • 2
4 Comments
 

Author Comment

by:jcao
ID: 1210231
Edited text of question
0
 
LVL 4

Expert Comment

by:martinag
ID: 1210232
Are you using Apache as server software (if it's a UNIX, then it's most likely Apache)? I can give you a solution for it.

Martin
0
 

Accepted Solution

by:
hap earned 100 total points
ID: 1210233
Assuming your using Apache like everyone else, you can find more than 20 password protection scripts at:
http://www.freeperlcode.com/guide/Password_Protection/

However, if you want to do it yourself:
---------------------------------------------------------------------------------
Multiple User/Group Protection:

     1. Create the directory your want to protect.

     2. Create a file .htgroup that contains the group name and list of users:

                 member-users: user1 user2 user3

     3. Modify .htaccess, so it looks similar to:

                 AuthUserFile /homeX/domain/.htpasswd
                 AuthGroupFile /homeX/domain/.htgroup
                 AuthName ByPassword
                 AuthType Basic

                 &ltLimit GET>
                 require group member-users
                 </Limit>

     4. Create the password file .htpasswd using the program htpasswd for
        each user (as above in part 1) You don't need the -c option if you
        are using the same .htpasswd file (-c is used to create a new file).

         htpasswd /homeX/domain/.htpasswd user1
         htpasswd /homeX/domain/.htpasswd user2
         and so on...

     5. Remember to add any new users to the .htgroup file.

     6. Now try to access a file in the protected directory by entering the
        set username and password when prompted for it.


     Notes: All files should have a blank line at the bottom and always use the
            full path to your configuration files;

            Replace "/homeX/domain/" with your server path to .htpasswd file;

            You may need to replace "/usr/local/bin/" with "/usr/bin/"


0
 

Author Comment

by:jcao
ID: 1210234
Thank you very much.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now