I dont really know what s going on about .HTPASswd thing.. HOW TO use to protect the admind.cgi?? please help
Mar 6, 1999, 5:04 PM
Veteran (1509 posts)
Mar 6, 1999, 5:04 PM
Post #2 of 14
Views: 10008
http://faq.web2010.com/htaccess.htm
--mark
------------------
You can reach my by ICQ at UID# 8602162
--mark
------------------
You can reach my by ICQ at UID# 8602162
Mar 6, 1999, 6:40 PM
User (64 posts)
Mar 6, 1999, 6:40 PM
Post #3 of 14
Views: 9911
Here is a script that makes it easier.
##########################################################################
#
# makeht.cgi
# Directions:
# Upload makeht.cgi to the directory you want to protect.
# Chmod to 755
# Run makht.cgi with your browser
# http://yoursite.com/protecteddirectory/makeht.cgi?username/password
# Your directory is now protected.
#
##########################################################################
print "Content-type:text/html\n\n";
eval '$home = (getpwuid($< ))[7];';
if (!-e "C:/") {
$pwd = `pwd`; chop $pwd;
}
if (!eval 'use Cwd;') {
eval '$cwd = cwd();';
} else {
$cwd = "";
}
($uname, $pword) = split(/\//,$ENV{'QUERY_STRING'});
if ($pwd eq "") {
$dirname = $cwd;
} else {
$dirname = $pwd;
}
if ($dirname eq "") {
&dienice("Error determining directory");
}
if ($uname eq "") {
&dienice("Error determining username");
}
if ($pword eq "") {
&dienice("Error determining password");
}
$cpass = crypt ($pword ,"Cd");
open (HTACC,">.htaccess") or &dienice("Error opening htaccess");
print HTACC qq~AuthName Links Admin
AuthType Basic
AuthUserFile $dirname/.htpasswd
require valid-user
~;
close(HTACC);
open (HTPWD,">.htpasswd") or &dienice("Error opening htpasswd");
print HTPWD "$uname:$cpass\n";
close(HTPWD);
print "Complete. Username: $uname Password: $pword Encrypted Password: $cpass";
sub dienice {
($msg) = @_;
print "<h2>Error</h2>\n";
print $msg;
exit;
}
------------------
JRM Studios http://www.jrmstudios.com
The Hotrodding Network http://www.jrmstudios.com/hotrodding
Code:
#!/usr/bin/perl ##########################################################################
#
# makeht.cgi
# Directions:
# Upload makeht.cgi to the directory you want to protect.
# Chmod to 755
# Run makht.cgi with your browser
# http://yoursite.com/protecteddirectory/makeht.cgi?username/password
# Your directory is now protected.
#
##########################################################################
print "Content-type:text/html\n\n";
eval '$home = (getpwuid($< ))[7];';
if (!-e "C:/") {
$pwd = `pwd`; chop $pwd;
}
if (!eval 'use Cwd;') {
eval '$cwd = cwd();';
} else {
$cwd = "";
}
($uname, $pword) = split(/\//,$ENV{'QUERY_STRING'});
if ($pwd eq "") {
$dirname = $cwd;
} else {
$dirname = $pwd;
}
if ($dirname eq "") {
&dienice("Error determining directory");
}
if ($uname eq "") {
&dienice("Error determining username");
}
if ($pword eq "") {
&dienice("Error determining password");
}
$cpass = crypt ($pword ,"Cd");
open (HTACC,">.htaccess") or &dienice("Error opening htaccess");
print HTACC qq~AuthName Links Admin
AuthType Basic
AuthUserFile $dirname/.htpasswd
require valid-user
~;
close(HTACC);
open (HTPWD,">.htpasswd") or &dienice("Error opening htpasswd");
print HTPWD "$uname:$cpass\n";
close(HTPWD);
print "Complete. Username: $uname Password: $pword Encrypted Password: $cpass";
sub dienice {
($msg) = @_;
print "<h2>Error</h2>\n";
print $msg;
exit;
}
------------------
JRM Studios http://www.jrmstudios.com
The Hotrodding Network http://www.jrmstudios.com/hotrodding
Mar 6, 1999, 10:08 PM
User (64 posts)
Mar 6, 1999, 10:08 PM
Post #5 of 14
Views: 9867
Name it makeht.cgi
Put it in the dir you want to protect.
type http://yoursite.com/protecteddirectory/makeht.cgi?username/password in your browser.
Replace "yoursite.com/protecteddirectory" with the location of the file
Replace "username" with your user name.
Replace "password" with your password.
That's it.
------------------
JRM Studios www.jrmstudios.com
The Hotrodding Network www.jrmstudios.com/hotrodding
Put it in the dir you want to protect.
type http://yoursite.com/protecteddirectory/makeht.cgi?username/password in your browser.
Replace "yoursite.com/protecteddirectory" with the location of the file
Replace "username" with your user name.
Replace "password" with your password.
That's it.
------------------
JRM Studios www.jrmstudios.com
The Hotrodding Network www.jrmstudios.com/hotrodding
Mar 7, 1999, 1:30 PM
User (64 posts)
Mar 7, 1999, 1:30 PM
Post #7 of 14
Views: 9910
Just delete the .htaccess and .htpassword files with your FTP program. Then do it again.
------------------
JRM Studios www.jrmstudios.com
The Hotrodding Network www.jrmstudios.com/hotrodding
------------------
JRM Studios www.jrmstudios.com
The Hotrodding Network www.jrmstudios.com/hotrodding
Mar 7, 1999, 5:46 PM
User (64 posts)
Mar 7, 1999, 5:46 PM
Post #9 of 14
Views: 9927
The script creates them.
------------------
JRM Studios www.jrmstudios.com
The Hotrodding Network www.jrmstudios.com/hotrodding
------------------
JRM Studios www.jrmstudios.com
The Hotrodding Network www.jrmstudios.com/hotrodding
Mar 7, 1999, 6:04 PM
Novice (36 posts)
Mar 7, 1999, 6:04 PM
Post #10 of 14
Views: 9962
NO, you DO NOT!
Just copy the script he gave us...
then upload to the dir. you want to protect
and type as
http://www.YOURNAME.com/admin/protect.cgi?username/password
username = your name
password = your password
protect.cgi = if you save your scipt as protec.cgi else change it to whatever you name it...
good luck
Just copy the script he gave us...
then upload to the dir. you want to protect
and type as
http://www.YOURNAME.com/admin/protect.cgi?username/password
username = your name
password = your password
protect.cgi = if you save your scipt as protec.cgi else change it to whatever you name it...
good luck
Mar 9, 1999, 7:36 AM
Novice (36 posts)
Mar 9, 1999, 7:36 AM
Post #12 of 14
Views: 9919
As You SERVER Administrator.
I uploaded to mine
and I typed
http://www.MYNAME.net/cgi-bin/admin/pro.cgi?MYNAME/MYPASSWORD
and I hit enter, it crypted and no one can see.
I dont know what happened, try to install to another dir to see if it work or not...
good luck again
I uploaded to mine
and I typed
http://www.MYNAME.net/cgi-bin/admin/pro.cgi?MYNAME/MYPASSWORD
and I hit enter, it crypted and no one can see.
I dont know what happened, try to install to another dir to see if it work or not...
good luck again
Mar 23, 1999, 11:33 AM
User (88 posts)
Mar 23, 1999, 11:33 AM
Post #14 of 14
Views: 9961
trijason just get the file manager script on this site. I does lots of things, even password protection.
------------------
Patrick Chukwura
http://nytesoft.hypermart.net
------------------
Patrick Chukwura
http://nytesoft.hypermart.net