Password Protect Files

Securing your data on CalicoHosting.com is easy.

Configuring .htpasswd and .htaccess to require secure authentication

  1. SSH into your CalicoHosting.com account with your favorite SSH program. We like Putty and Secure CRT.
  2. Navigate to the folder you want to protect (e.g. ...htdocs/securearea/) and type "nano .htaccess" (without the quotes)
  3. Your .htaccess file should look something like this:
    AuthType Basic
    AuthName "USERNAME"
    (replace USERNAME with the username, in caps)
    AuthUserFile /home/websites/yourdomain.com/.htpasswd
    (replace yourdomain.com with...)
    Require valid-user
  4. Save the file as .htaccess and navigate to the path specified in the third line of the .htaccess file you just created.
  5. Type "htpasswd -b .htpasswd username password" (without the quotes, replacing 'username' and 'password' with the desired login and passwd.
  6. With a browser, like FireFox, try to view a page in the now-password protected folder. If you enter the wrong authentication, you will be unable to view the page.