[Samba] Vampire and Capital Letters

Rune Tønnesen rune at tonnesen.org
Mon Apr 30 15:30:47 GMT 2007


Simon Faulkner skrev:
> I find Linux to be a nightmare if usernames have capital letters.
>
> Some old Windows PDCs that we are vampiring have usernames with 
> capital letters.
>
> AFAIK you can't change a windows username
>
> Is there a way of telling the vampire to make all usernames lowercase 
> as it imports them?
>
> Can I use pdbedit or any other tool to make them lowercase?
>
> At the moment I am changing /etc/passwd and the rest in vi then binary 
> editing passdb.tdb to make them lower case - ugh!
>
> What do other folks do?
>
> TIA
>
> Sim
Hi Simon

If its is possible to wampire with smbpasswd backend then here is a 
shotcut to get things done or be inspired. I've not used wampire myself. 
If you can not do wampire with smbpasswd backend then you might be able 
to export your tdbsam to smbpasswd using /pdbedit -i tdbsam -e smbpasswd.
/

   1. Use smbpasswd as the first password backend, /passdb backend =
      smbpasswd:/etc/samba/smbpasswd tdbsam:/etc/samba/passdb.tdb/
      because then you get the usernames into a testfile.
   2. Do the wampire trick
   3. /cat /etc/samba/smbpasswd | tr '[:upper:]' '[:lower:]' >>
      /etc/samba/lc-smbpasswd/
   4. change /passdb backend = smbpasswd:/etc/samba/smbpasswd
      tdbsam:/etc/samba/passdb.tdb/ TO /passdb backend =
      smbpasswd:/etc/samba/lc-smbpasswd tdbsam:/etc/samba/passdb.tdb/
   5. run /pdbedit -i smbpasswd -e tdbsam/ to export the content of
      smbpasswd and then import it to tdbsam
   6. remove lc-smbpasswd from /passdb backend =
      smbpasswd:/etc/samba/lc-smbpasswd tdbsam:/etc/samba/passdb.tdb/ so
      you get /passdb backend = tdbsam:/etc/samba/passdb.tdb/
   7. run pdbedit -Lv to check things are working ok

the tr program is the trick in this case, som perl scripts might be able 
to do the same lowercase conversion

-- 
Venlig Hilsen (Best Regards)
stud. med. Rune Tønnesen



More information about the samba mailing list