[Samba] FreeBSD: Changing UNIX password - Password Chat?

Edmundo Valle Neto edmundo.valle at terra.com.br
Thu Feb 14 01:03:32 GMT 2008

Jon Theil Nielsen escreveu:
> 2008/2/13, Edmundo Valle Neto <edmundo.valle at terra.com.br>:
>> Jon Theil Nielsen escreveu:
>>> I can't get my Samba PDC (FreeBSD 7,0-BETA3) changing UNIX passwords
>>> from Windows clients (Ctrl-Alt-Del).
>>> I now have the password chat debug active and I have loglevel 100.
>>> I am not certain about the syntax in the password chat. But if I from
>>> a console try to change the password of a given user (here testuser1),
>>> I see these lines:
>>> mflserver3# /usr/bin/passwd testuser1
>>> Changing local password for testuser1
>>> New Password: (entering the password)
>>> Retype New Password: (entering it again)
>>> >From that i guess the expression in the chat would be:
>>> *Changing*local*password*for* %u\n *New*Password* %n\n
>>> *Retype*New*Password* %n\n
>> (...)
> And again something is completely wrong, I see.
> As I said, I am far from confident with the syntax/mecanism here. So I
> would really appreciate some more explicit help. I have tried to
> modify the chat by removing the trailing "*" or by putting the
> expressions into double quotes - but with no luck.
> Again, what is going on in the console is exactely what I wrote above.
> What would then be tbe correct chat?
> Regards,
> Jon Theil Nielsen

Your problem is not the trailing *, you can't use %u.
Its just strings with wildcards, "WATCH THIS" send this "WATCH THIS" 
send this.

I think that even if you do that "C*:" it works as you have only one C 
and only one : before the first iteration.
It matches anything in the middle, Cblablablablablablablab\nlablabla 

passwd chat = "Changing local password for*\nNew Password*" %n\n 
"*Retype New Password*" %n\n

Have you ever used regular expressions? This is a hundred times simpler :)
Its a sintax based on a unix program called "expect" that is used in 
automation. It feeds command line programs that doesn't accept options.


Edmundo Valle Neto

More information about the samba mailing list