Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
09-30-2005, 05:34 PM
|
#1
|
Member
Registered: May 2004
Posts: 43
Rep:
|
login problems - htaccess / htpasswd
Redhat9, Apache 2.0.
Apache serves 'unprotected' pages just fine. Create .htaccess and .htpasswd files, restart httpd, and can get a login prompt as specified in htaccess, but wont accept passwords! Just kicks back to login as if entered wrong pwd. I'm trying to login from a WinXP system. Here is .htaccess:
AuthName "Log into private area"
AuthType Basic
AuthUserFile /home/mike/.htpasswd
Require user music
So then I created .htapsswd to be in my home dir (cuz I read it's not ideal to have it in the same dir you're protecting?) with user 'music' and pwd 'musak':
htpasswd -cb /home/mike/.htpasswd music musak
After running "htpasswd --help", I saw the different encryption options and tried 'em all, but all failed the same way as above. 'music' doesnt need to be an existing user on this linux box, right? In case it did, I changed Require line to valid-user and used an existing user on this system and it still failed the same way.
Please shed some light... Thx
|
|
|
09-30-2005, 06:17 PM
|
#2
|
Slackware Contributor
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559
|
I wonder...
Can the account that the apache daemon runs as (it would be the user httpd or apache) read that file in /home/mike? Old Redhats protect users' home directories by denying the "other" group all access. You'll need at least the 'x' access bit for "others" set for your homedirectory (drwx--x--x for instance) for apache to see that .htpasswd file.
Run
Code:
chmod o+x /home/mike
and try logging in again.
Also, the .htpasswd file itself should at least be readable by the apache process....
Code:
chmod o+r /home/mike/.htpasswd
Eric
|
|
|
10-01-2005, 12:53 AM
|
#3
|
Member
Registered: May 2004
Posts: 43
Original Poster
Rep:
|
you got it! thanks a lot!
|
|
|
10-01-2005, 01:16 AM
|
#4
|
Member
Registered: Feb 2004
Location: Outermost mingetty
Distribution: RHEL3,RH4U4,Sol9, Sol10
Posts: 321
Rep:
|
Usually the .htpasswd file is on a non-web-accessible branch of the apache tree, such as /usr/local/apache/passwords, or /etc/httpd/passwords, which makes it easier to configure for apache to read, without opening your home directory to everyone.
http://httpd.apache.org/docs/2.0/howto/auth.html
|
|
|
10-03-2005, 04:18 PM
|
#5
|
Member
Registered: May 2004
Posts: 43
Original Poster
Rep:
|
duly noted!
|
|
|
All times are GMT -5. The time now is 07:27 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|