How do I secure all web pages in a directory?

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.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Can I password protect directories?

  Yes, you can password protect any directories and files placed within them. To do that,...

How much space is used for the OS?

The space usage by default depends heavily on the OS development, and what modules are installed...

I need a FTP program, which one is the best?

  We strongly recommend that you use FileZilla. Not only because it's open source, but...

What is the maximum IPs that I can have on my VPS?

While we try very hard to ensure that everyone has enough IPs, we have a maximum IPs per...

How do I install the Zend Optimizer?

By default on all our hosting accounts, Zend / IonCube are installed. So there is no need to...

Powered by WHMCompleteSolution