linux,ubuntu linux,ubuntu guide,linux technical documentation

.htpasswd Setup in ubuntu

by admin on May.30, 2010, under RHEL5, Ubuntu, Ubuntu 9.10, ubuntu 10.04, ubuntu 7.10, ubuntu 8.04, ubuntu 8.10, ubuntu 9.04

In our site we can can limit access only to parties with usernames and passwords (provided by us) by using .htaccess, a basic security function built into the HTTP protocol.

The .htaccess file must be placed in the directory you want protected.
ex)
here site is the web directory
#cd /var/www/site
#vim .htaccess
Then add the following
AuthUserFile /var/www/site/.htpasswd
AuthGroupFile /dev/null
AuthName “Private”
AuthType Basic
require valid-user
Then save the file and exit
#sudo htpasswd -c /var/www/site/.htpasswd username
.htpasswd is where you will place the list of authorized usernames and passwords. The format is as follows:

username:password

Passwords are in an encrypted form.

:, , , , ,

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

Archives

All entries, chronologically...