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 04-13-2009, 03:37 PM   #1
shachter
Member
 
Registered: Jul 2007
Posts: 101

Rep: Reputation: 2
Apache case-insensitive username matching with .htaccess directives?


As the title of this posting implies, this is an
Apache question more than a Linux question, but I
believe that most Apache administrators are Linux
users, so my use of linuxquestions.org for this
question is not, I hope, inapt.

I wish to restrict access to a certain directory on
a webserver, such that only users who supply a valid
username and password can see the documents stored
in that directory. Encryption of the username and
password is not required, nor is encryption of the
protected content.

This is a very modest requirement, and it can be very
easily met. I create an .htaccess file in the
directory, containing the following:

AuthName [a name appears here]
AuthType Basic
AuthUserFile [the name of an .htpasswd file]
<Limit GET POST>
require valid-user
</Limit>

So far, this is all very elementary. But I have one
more requirement. I want username authentication to
occur in a case-insensitive manner. Thus, if "jay"
is an authorized user, when jay's browser pops up
a window asking for name and password, I want jay to
be able to type "jay", or "Jay", or "JAY", or even
"JaY", and I want all of them to map to the line in
the .htpasswd file beginning with "jay:".

The password, in contrast, should be case-sensitive.

I can find no way of doing this, short of changing
code in mod_ntlm.c and recompiling apache, but that
would be a sledgehammer solution to a problem
requiring a paperclip. This is perhaps an imperfect
metaphor, but you get my point. The idea is not to
make all of apache's username authentication case-
insensitive -- just to do so for one particular
directory.

It stands to reason that there should be something
that one can put into the .htaccess file to request
this functionality, but I have looked for such a
thing, and have not found it. The only solution I
have come up with is completely impractical: to have
separate lines in the .htpasswd file for each
variation of a username, all containg the same
encrypted password to the right of the colon.
But this is, of course, utterly bogus. It would
require, e.g., 1024 different lines for a 10-letter
username.

I retain hope that there is some poorly-documented,
or, perhaps, undocumented, feature that provides the
functionality I seek, because I do not think the
request is unreasonable, and I cannot possibly be
the first person who has sought this functionality.
Any replies will be most appreciated, and I thank you
in advance for them all.

Jay F. Shachter
6424 North Whipple Street
Chicago IL 60645-4111

(1-773) 7613784
jay@m5.chicago.il.us
 
Old 04-15-2009, 03:24 AM   #2
saman007uk
Member
 
Registered: Dec 2003
Location: ~root
Distribution: Debian
Posts: 364

Rep: Reputation: 33
Unfortunately, I don't believe that this is possible.

You will have to use either of the two soutions that you suggested in your post.
 
Old 04-15-2009, 11:40 AM   #3
archangel_617b
Member
 
Registered: Sep 2003
Location: GMT -08:00
Distribution: Ubuntu, RHEL/CentOS, Fedora
Posts: 234

Rep: Reputation: 42
This may be taking the thread off topic, but I think if you try offloading your auth to LDAP, the authentication should validate user names in a case insensitive way.

- Arch
 
  


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
how to search in VI wih case insensitive lordofring Programming 7 11-16-2011 08:11 AM
Case insensitive authentication with PAM BillyCrook Linux - General 11 07-02-2008 03:54 AM
Copying files from case-sensitive Linux to case-insensitive Windows via CIFS? SlowCoder Linux - General 4 05-07-2008 07:03 PM
Case-insensitive CVS? sundialsvcs Programming 2 06-25-2006 10:01 AM
case-insensitive auto-complete gSalsero Programming 3 06-08-2004 07:33 AM

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

All times are GMT -5. The time now is 07:09 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