LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-31-2013, 09:09 AM   #1
hahacc
Member
 
Registered: Oct 2010
Posts: 93

Rep: Reputation: 1
weird thing about httpd Auth module mod_authn_file


Hi folks,
I'm using httpd mod_authn_file for authenticating against a directory of my site, but I found I can pass the authentication with wrong password!
Here's the configuration:
Code:
<Directory /var/www/html/mysite/dir1>
AuthName "Need-password"
AuthType Basic
AuthUserFile /var/www/html/mysite/dir1/htpasswd.me
Require valid-user
Options +Indexes
AuthBasicProvider file
</Directory>
The module was loaded:
Code:
LoadModule authn_file_module modules/mod_authn_file.so
And I've set htpasswd.me with right permission:
Code:
[root@doxer_#1]# ls -l /var/www/html/mysite/dir1/htpasswd.me
-rw------- 1 apache apache 21 Jul 31 07:47 /var/www/html/mysite/dir1/htpasswd.me
I generated password using the right htpasswd -c /var/www/html/mysite/dir1/htpasswd.me username.

The sympotom is that:
  1. When I entered the wrong username, authentication will fail with right/wrong password;
  2. When I entered the right username, and the first several characters of the right password as password, authentication will pass!(this really puzzled me! For example, the right password was 'PassWord', but I found that 'PassWore' or 'PassWordExtra' would both pass!)

Can anyone shed some light on this? Thanks!

PS:Server version: Apache/2.2.3

.

Last edited by hahacc; 07-31-2013 at 09:14 AM.
 
Old 08-01-2013, 06:04 AM   #2
vishesh
Member
 
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 661

Rep: Reputation: 66
I tried same configuration but not taking incomplete password.

Thanks
 
Old 08-01-2013, 07:05 AM   #3
eklavya
Member
 
Registered: Mar 2013
Posts: 636

Rep: Reputation: 142Reputation: 142
if you are talking about htaccess username & password. Don't try using just refresh the link.
Close the browser and open again and now execute the link.
or
try in different browsers. Open new browser (cleared cookies & cache) and now put the wrong password, it will not take it.
But once you put the correct password and try in same browser without closing it, it can take incorrect one.

I am saying this because I had faced same issue.
 
Old 08-06-2013, 05:16 AM   #4
hahacc
Member
 
Registered: Oct 2010
Posts: 93

Original Poster
Rep: Reputation: 1
Thanks guys, but this weird issue still the same on my box, even I changed another host.
 
Old 08-07-2013, 02:31 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
The sympotom is that:

When I entered the wrong username, authentication will fail with right/wrong password;
When I entered the right username, and the first several characters of the right password as password, authentication will pass!(this really puzzled me! For example, the right password was 'PassWord', but I found that 'PassWore' or 'PassWordExtra' would both pass!)


Can anyone shed some light on this? Thanks!

PS:Server version: Apache/2.2.3
This is a problem for apache versions up to 2.2.17
Quote:
-d
Use crypt() encryption for passwords. This is not supported by the httpd server on Windows and Netware. This algorithm limits the password length to 8 characters. This algorithm is insecure by today's standards. It used to be the default algorithm until version 2.2.17.
You can use -m in htpasswd to encrypt the password using the md5 algorithm. See the link above for more details

Regards
 
Old 08-11-2013, 10:30 PM   #6
hahacc
Member
 
Registered: Oct 2010
Posts: 93

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by bathory View Post
This is a problem for apache versions up to 2.2.17

You can use -m in htpasswd to encrypt the password using the md5 algorithm. See the link above for more details

Regards
Awesome, thanks a lot! I had another try with -m and it worked as expected!
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
weird thing just now.. mike2010 Linux - Security 8 04-05-2010 09:08 AM
Such a weird thing. 0xMarvel Linux - Newbie 11 07-10-2008 07:14 AM
Apache Auth Password in httpd.conf ignored barlowbj Linux - Newbie 3 09-30-2003 07:42 AM
Weird thing Andreas T. Linux - General 1 05-10-2002 03:12 PM
weird thing... kizaroth Linux - Newbie 3 10-21-2001 02:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration