Site Panel Help User Panel Help Panel Demo's Search Help

Categories

· Show all categories

· New Customer FAQs
· E-Mail
· FTP - File Transfers
· Domains
· SSH and Telnet
· Scripting Languages
· Password Protection
· MySQL
· Stats
· Power Tools

· FAQ Home

· EchoEcho+ Support

Password Protection: ADVANCED: Handmade Password Protection
This FAQ describes how you can add the files that are required to password protect a folder. It is simpler to just add password protection from the site owner panel (as described in the other article on Password Protection) - but if you need more advanced control option you can use the information in this article.

Password protection is a 2 step proces.
1: Create a file with the usernames and passwords
2: Upload a ".htaccess" file to protected folder(s)


-----------------------------------------------------------------------------
1): Create the file file that will hold the usernames and passwords:
-----------------------------------------------------------------------------
1.1) Login with SSH to the server

1.2) Goto your home folder ("cd /home/admin" or "cd /home/username")

1.3) Type this command to create a new password file with the first user:
------------------------------
htpasswd -c .htpasswd george (replace "george" with a username you like)
------------------------------
You will now be asked to enter the password for the username you specified.

1.3a): Optional: Add more users to the password file
The "-c" used above creates the new password file.
To add more users, do the same, but without the "-c" part.
For example:
------------------------------
htpasswd .htpasswd joe
htpasswd .htpasswd bill
-----------------------------------------------------------------------------



-----------------------------------------------------------------------------
2): Protect the folder(s):
-----------------------------------------------------------------------------
2.1) Create a plain text file with any plain text editor you like.
The file should look like this:
------------------------------
AuthUserFile /home/virtual/example.com/home/admin/.htpasswd
AuthName "Restricted Area"
AuthType Basic
Require valid-user
------------------------------
Note:
- Replace "example.com" with your real domain name.
- Make sure "/home/admin/.htpasswd" points to the file you created under 1).
Save the file as "htaccess.txt".

2.2) Upload the file to the folder you want to protect.

2.3) Rename the file to ".htaccess". (Note the dot as first character)
-----------------------------------------------------------------------------

That's it.

You can read about advanced options for the Apache web server here.

Last update: 12.07.2009, 21:18
Author: EchoEcho Support

printer-friendly version Send to a friend
Show this as PDF file export as XML-File

Average rating: 0 from 5 (0 Votes )

Please rate this entry:
completely
useless

1

2

3

4

5
most
valuable
You cannot comment on this entry | Content Overview: Password Protection
Copyright © EchoEchoPlus Hosting