Knowledgebase: Security
How do I secure all web pages in a directory?
Posted by Admin on 25 July 2003 06:55 PM
Please use the browser control panel interface for password protecting your web pages.

Or via telnet, if your home directory is yourlogin, create a file named .htaccess in your web directory that contains the following:

AuthUserFile /home/yourlogin/.htpasswd
AuthGroupFile /dev/null
AuthName ByPassword
AuthType Basic

require user pumpkin


Then in your home directory, type htpasswd -c .htpasswd pumpkin. This will enable you to secure the directory so that only user pumpkin can 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 that you want to store the .htpasswd file in your home directory so it is hidden from others. The one drawback to putting your .htpasswd file in your home directory is that you will have to slightly lower the security of your home directory. Go to /home and type chmod +x yourlogin. The web server needs execute permission on to read the .htpasswd file.
(1082 vote(s))
This article was helpful
This article was not helpful

Comments (12)
Crazy
25 January 2007 10:20 AM
Pol
25 January 2007 10:20 AM
His_wife
25 January 2007 10:20 AM
Maxx
02 February 2007 04:31 PM
Wolf
02 February 2007 04:31 PM
Merlin
02 February 2007 04:31 PM
Settor
02 February 2007 04:32 PM
Stinky
02 February 2007 04:32 PM
BadGirl
04 February 2007 08:43 PM
Sad
04 February 2007 08:44 PM
His_wife
06 February 2007 09:26 PM
Faggot
06 February 2007 09:26 PM
Post a new comment
 
 
Full Name:
Email:
Comments:
Help Desk Software by Kayako Resolve