Can anyone help with .htaccess? - (a little off topic)Can anyone help with .htaccess

They have: 5,633 posts

Joined: Jan 1970

Hello,

I know this might be a little off topic however I didn't know where to ask.

I'm trying to set up a password protected directory,using htaccess

my .htaccess file looks like

AuthUserFile /home/jamesm/.htpasswd
AuthGroupFile /dev/null
AuthName Protected
AuthType Basic
<Limit GET>
require valid-user
</Limit>

and my .htpasswd file looks like
this

test:test

When Igo to the directory that I wanted to protect it works I get prompt for a user name and password however my problem is its not letting me in using test for user name and password I tried changing the .htpassword file and create other user ids however they didn't work either could anyone help?

I'm using Red Hat Linux if that helps

thanks in advance.

John Pollock's picture

He has: 628 posts

Joined: Mar 1999

I think you have to create the username and password through telnet.
Upload a blank .htpasswd file, and then try this via telnet to your server:

For the first user, try this command (make sure the paths are correct for your system):

/usr/sbin/htpasswd -c /home/jamesm/.htpasswd

To add additional users, use this:

/usr/sbin/htpasswd /home/jamesm/.htpasswd

Hopefully that will get it working for you. Smiling

----------
John Pollock
http://www.pageresource.com

They have: 1,587 posts

Joined: Mar 1999

There's an excellent page with easy to understand instructions at my search engine site, link below. Hope it helps, it helped me that's why I listed it.

----------
Get listed on a search engine/directory within 24 hrs. FREE!
http://www.birminghamnet.com/cgi-bin/links/pages/

Traffic-Website.com free traffic, affiliate programs, hosting, & domain names.
My Site got hacked, but i'm coming back?

They have: 99 posts

Joined: May 1999

There's a web site at:
http://www.apacheweek.com/features/userauth

It walks you thru the various scenarios to do this.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.