How to Setup password protected
web directories:
In order to password protect your web directories,
you must login to your shell account through SSH (Secure Shell).
It encrypts the connection between you and the server. If you are
using windows or mac you can find free SSH clients from this page:
http://www.openssh.org/windows.html
To setup password protected directories, ssh to yourdomainname.com
and login using the same username and password as your FTP.
Once you get to the prompt, enter your public_html
folder by typing:
cd public_html
To create a directory that you wish to be password
protected type:
mkdir directoryname
(where directoryname is the directory you wish to
make.)
Type:
cd directoryname
You will need to create a .htaccess file, you can
create it in any plain text editor and uploaded to your directory
name or you can type this:
edit .htaccess
and enter this info:
AuthUserFile /home/username/public_html/directoryname/passwordfile
AuthName "My Secure Area"
AuthType Basic
<Limit GET POST PUT>
require valid-user
</Limit>
(where username is the name assigned to you by Swishmail)
Press ESC, select "a" Leave editor and
press enter, select "a" save changes and press enter
Now you will need to create the password file by typing:
htpasswd -c passwordfile username
The passwordfile you can change to the password file
you wish to use, like .secret instead, but make sure it's called
whatever you called it in .htaccess file. Once the passwordfile
has been created, to change/add users type:
htpasswd passwordfile username
without the -c (-c is a create new file switch)
|