![]() |
|
|
|
Create a file named .htaccess in the web directory that you want secured. This file should contain the following:
AuthUserFile /home/yourlogin/.htpasswd
AuthGroupFile /dev/null
AuthName ByPassword
AuthType Basic
<Limit GET POST>
require user pumpkin
</Limit>
Be sure to replace the "yourlogin" with your login ID.Then in your home directory, type htpasswd -c .htpasswd pumpkinYou will be prompted to enter the password for the user pumpkin. Do this for all accounts that you wish to add. The same command will work to change an existing password also. This will enable you to secure the directory so that only the user pumpkin enter this directory. You may well want any of the user/password combinations you created in your .htpasswd file to allow access. Just say require valid-user instead of require user xxx in .htaccess and any of the users you created will be able to access the files. Note: You want to store the .htpasswd file in your home directory so it is hidden from others. For more advanced usage such as permitting access by groups take a look at NCSA's tutorial. Information provided by: |
||||||||||||||||||||