Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2005-06-12, 02:42 PM   #1
MadMax
"Without evil there can be no good, so it must be good to be evil sometimes" ~ Satan
 
MadMax's Avatar
 
Join Date: Aug 2004
Location: Motor City, baby, where carjacking was invented! Now GIMME THOSE SHOES!
Posts: 2,385
.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
MadMax is offline   Reply With Quote
Old 2005-06-12, 02:57 PM   #2
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
.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:
<?php
print crypt('test','ab');
?>
And take the output from that and upload a file called .htpasswd that contains:

username:outputfromabove
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote
Old 2005-06-12, 03:15 PM   #3
Cleo
Subversive filth of the hedonistic decadent West
 
Cleo's Avatar
 
Join Date: Mar 2003
Location: Southeast Florida
Posts: 27,936
Here is a page that will generate the encrypted passwords without using a shell
http://www.e2.u-net.com/htaccess/make.htm
__________________
Free Rides on Uber and Lyft
Uber Car: uberTzTerri
Lyft Car: TZ896289
Cleo is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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