Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

We have integrated a linux thin client with an AD using kerberos, pam and winbindd. We are using pam_mkhomedir to make the home dir, and that works fine. But the login scripts don't run when the AD users use mixed or upper case in there usernames. AD are case insensitive, it doesn't care if the users uses "name" or "Name". So when user "bob" login in with "Bob" he gets home dir /home/bob but user name Bob, not really the same in linux. I what the username to always be converted to lower case, is that possible?

# Pam file # 
auth        sufficient nullok try_first_pass               
auth        sufficient use_first_pass                      
auth        sufficient use_first_pass                   
auth        required                        

account     required                              
account     sufficient broken_shadow debug              
account     sufficient                             
account     sufficient uid < 100 quiet            
account     [default=bad success=ok user_unknown=ignore]
account     required                                

password    sufficient md5 shadow nullok try_first_pass use_authtok
password    sufficient use_authtok                                 
password    sufficient use_authtok                              
password    required                                             

session     optional umask=0022 skel=/etc/skel/ debug       
session     optional revoke                                   
session     required                                           
session     [success=1 default=ignore] service in crond quiet use_uid
session     optional                                                  
session     optional ccache=/tmp/krb5cc_%u       
share|improve this question

1 Answer 1

up vote 1 down vote accepted

You can use the pam_regex module to transform all usernames to lower-case if you wish.

Though I'd question why you'd wish to allow mixed case names in the first place, it seems like a recipe for confusion and torment.

share|improve this answer
Great I will test that. We have migrated from WinCE to Linux, and the users are used to use Mixed case. – xpatrikh Sep 13 '11 at 7:20
Yes, that seems to work. I use this line: auth requisite extended transform=s/.*/\L&/g; – xpatrikh Sep 22 '11 at 9:19
To also normalize swedish chars, I use: auth requisite extended transform=s/.*/\L&/g;s/<E4>/a/g;s/<C4>/a/g;s/<E5>/a/g;s/<C5>/a/g;s/<F6>/o/g;s/<D‌​6>/o/g;s/å/a/g;s/Å/a/g;s/ä/a/g;s/Ä/a/g;s/ö/a/g;s/Ö/a/g – xpatrikh Sep 23 '11 at 9:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.