Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Help Password Protection for Admin dir

Quote Reply
Help Password Protection for Admin dir
Can anyone help me setup or supply a way to protect the admin dir for the free for all links. I would like to allow my guest to submit their urls for free. But I wouldn't like to allow the hackers to get into the admin directory and change all kinds of things.

Sincerely,

Michael T. Cronin
Talk22@hotmail.com
Quote Reply
Re: Help Password Protection for Admin dir In reply to
If your server uses "plusmail", that will offer a simple solution.

Also, FrontPage98 offers some directory password protecion options under "Tools".

Otherwise, you may want to ask your hosting company how to password protect a specific directory.

Hope that helps!

Brian Rooney

------------------
Total Success Solutions, Inc.
http://www.tssolutions.com/
Quote Reply
Re: Help Password Protection for Admin dir In reply to
Run this CGI in your admin directory.

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.hotrodding.net