Skip to main content
IBM  
Shop Support Downloads
IBM Home Products Consulting Industries News About IBM
IBM developerWorks : Security : Education - Tutorials
Securing your Web server
ZIPPDF (letter)PDF (A4)e-mail
Main menuSection menuFeedbackPreviousNext
3. User authentication
  


Creating the password file page 3 of 12


The first step is to create a directory where the password file will reside (preferably above the DocumentRoot where root or an authorized user can access it). Next, 'su' to root and create the password file by using the Apache utility htpasswd. For detailed instructions on the use of htpasswd, see the manual page; for a quick "reminder" of command line options simply type htpasswd without any arguments.


[root@thor httpd]# mkdir /home/httpd/useraccess
[root@thor httpd]# cd useraccess
[root@thor useraccess]# htpasswd -c basic tom
New password: dontpanic
Re-type password: dontpanic
Adding password for user tom

This creates a password file called basic, and adds an entry for user tom. Note that when htpasswd first creates the file, the '-c' (create) option is required. After this, simply specify the password file you want to add the user to and a username. With the password file in place, the next step is to add some directives to httpd.conf.


Main menuSection menuFeedbackPreviousNext
Privacy Legal Contact