Greenguy's Board

Greenguy's Board (http://www.greenguysboard.com/board/index.php)
-   Programming & Scripting (http://www.greenguysboard.com/board/forumdisplay.php?f=15)
-   -   .htaccess Password Protection (http://www.greenguysboard.com/board/showthread.php?t=20759)

MadMax 2005-06-12 02:42 PM

.htaccess Password Protection
 
I've got a couple directories for work in progress that I need an easy way to password protect. It would just be for a single username/password. I'm thinking .htaccess is probably the easiest way to go about it, but I'm not sure how to implement this. Any help out there?

TIA

cd34 2005-06-12 02:57 PM

.htaccess (adjusting the path to fit your area)
Code:

AuthUserFile /var/www/domain.com/admin/.htpasswd
AuthName "Members Only"
AuthType Basic

require valid-user

If you have shell access:

htpasswd -c /var/www/domain.com/admin/.htpasswd username

it will then prompt you for a password & verification

If you don't have shell, you can run this (test being of course the password you want to use):

Code:

print crypt('test','ab');
?>

And take the output from that and upload a file called .htpasswd that contains:

username:outputfromabove

Cleo 2005-06-12 03:15 PM

Here is a page that will generate the encrypted passwords without using a shell
http://www.e2.u-net.com/htaccess/make.htm


All times are GMT -4. The time now is 07:01 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc