[ SDF Public Access UNIX System .. Est. 1987 ]

join welcome faq status members projects store tour gopher abuse dialup minecraft social
tilde nihongo europa webmail gallery usermap irc tutorials telnet git ssh

[04] CAN I PASSWORD PROTECT MY DIRECTORIES?

     Yes you can.  You can create usernames and passwords for
     directories using the 'htpasswd' command.

     Follow these steps first!

     1. Create a file called '.htaccess' in the directory you 
        want to protect (NOTE, its not a directory in your
        HOME directory, but on the /www file system)

        AuthUserFILE /www/path/to/directory/.htpasswd
        AuthGroupFILE /dev/null
        AuthNAME "my protected files"
        AuthTYPE Basic
        require valid-user
        <limit GET POST PUT>
        order allow,deny
        allow from all
        </limit>

     2. run the 'htpasswd' command, for the first time:

        htpasswd -c .htpasswd myuser1

        You will be prompted to enter a password for the 
        new user.  After this first user is created, you
        can then add additional users with:

        htpasswd .htpasswd myuser2

     When you run 'mkhomepg -p', file permissions will be set so that
     only yourself and the webserver can read, execute and possibly
     write.  This helps if you have a cgi that requires your mysql
     password to be stored in it.
 
     If you wish to password protect a directory on the metaarray,
     you will need to enter the path 
     AuthUserFile /meta/www/a-z/username/private/.htpasswd
     where a-z is the beginning letter of your username and then 
     replace username for your username. 

[back]


©1987-2065 SDF Public Access UNIX System, Inc. 501(c)(7)
(this page was generated using ksh, sed and awk)