The following 69 words could not be found in the dictionary of 1150 words (including 1150 LocalSpellingWords) and are highlighted below:
again   argument   Auth   authentication   Basic   briefly   cd   command   example   explain   files   following   for   from   how   Howto   howto   htaccess   htpasswd   If   issue   last   list   mkdir   more   myusername   name   named   nano   new   on   parameter   Password   password   passwords   pathname   protect   Protection   public   put   Remember   remove   replace   Require   requires   sbin   Secret   secret   set   step   store   that   This   to   Type   up   User   user   username   usernames   usr   valid   var   want   webpage   where   which   will   with  

Clear message
Edit History Actions Discussion

Howto/Webpage/PasswordProtection

Howto: Password Protection

This howto will briefly explain how to set up a directory on your webpage that requires username/password authentication for access.

First, create a new directory in your public_html where you will put the files which you want to protect:

cd ~/public_html
mkdir secret

Create a file named .htaccess in the new directory with the following content (edit with: nano -w secret/.htaccess for example):

AuthUserFile /var/www/users/myusername/secret/.htpasswd
AuthName "Secret directory"
AuthType Basic
Require valid-user

Remember to replace myusername in the pathname with your username.

The last step is to create the file that will store your usernames and passwords:

/usr/sbin/htpasswd -c secret/.htpasswd username

The last parameter here (username) is the name of the user for which you want to create a new password. If you want to add more users remove -c (create new) from the argument list and issue the command again.


CategoryHowto