Sanjoy Roy

[MCM, MCP, SCJP] – Senior PHP Programmer

How to create a Password Protected Directory using linux command prompt?


Create a .htaccess file in the folder you want to set.
like:
#root@adu [/home/hostsite/public_html/admin]# vi .htaccess
copy and paste the following lines:
———————————————————-
AuthName “Secure Area”
AuthType Basic
AuthUserFile /home/hostsite/public_html/admin/.htpasswd
require valid-user
———————————————————-
Now set a password:
#htpasswd -c .htpasswd admin
New password: admin321
confirm password: admin321

You are done. test it: http://www.hostsite.com.au/admin and enter user name as admin and password as admin321

2 responses to “How to create a Password Protected Directory using linux command prompt?

  1. WP Text Pro Review 08/04/2012 at 5:29 AM

    I think that is among the most significant information for me. And i am glad studying your article. However want to statement on few general issues, The web site style is ideal, the articles is actually excellent : D. Just right process, cheers

  2. Auction Goods 11/07/2012 at 4:03 AM

    You are truly a good webmaster. The web site loading pace is amazing. It seems that you’re doing any unique trick. In addition, The contents are masterwork. you have done a excellent activity on this subject!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: