Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to use the smb.conf option "passwd program" to change our internal passwords (they are in a different database) when using the Windows "change password" function.

Here is a brief overview of the used configuration:

passdb backend = ldapsam:ldap://localhost
passwd program = /usr/local/bin/smbchat %u
passwd chat = *New*password*:* %n\n *Retype*new*password*:* %n\n *Replacing*
passwd chat debug = Yes
log level = 100
syslog = 0
log file = /var/log/samba/SAMBALOG

At the moment, my smbchat is not doing anything really, just logging the input:

echo `date` >> /tmp/smbchat.txt
echo $@ >> /tmp/smbchat.txt

echo "Stopping Name Service Cache Daemon: nscd."
echo -n "New password :"
read -s pass1
echo -n "Retype new password :"
read -s pass2
echo "Replacing ldap account dn: uid=user,ou=accounts,dc=dc01,dc=local"
echo "Starting Name Service Cache Daemon: nscd."
echo $pass1 >> /tmp/smbchat.txt
echo $pass2 >> /tmp/smbchat.txt

When manually invoking, i get the expected output in the logs. To verify it isn't a permissions problem I tried set the rights of /usr/local/bin/smbchat to 777.

As you can see above, i already tried out the debug option, but there only thing i could find in the log was

doing parameter passwd program = /usr/local/bin/smbchat %u
doing parameter passwd chat = *New*password*:* %n\n *Retype*new*password*:* %n\n *Replacing*
doing parameter passwd chat debug = yes

Samba version is 3.5.8, debian lenny.

When changing the password on a machine there is no output to the log. Any ideas how i can get this working?

share|improve this question
This could very well be a problem with Apparmor. However, as I know zero about apparmor on Debian systems, I can't point to where to look to find out. –  sysadmin1138 Jul 22 '12 at 14:23
There is no Apparmor on debian. –  Zulakis Jul 22 '12 at 14:28
> When manually invoking, everything is working. With "everything" being - what, exactly ? It's not doing anything other than writing stuff to a file in /tmp, and that doesn't require any permissions. What exactly is "not working" when invoked from samba ? > To verify it isn't a permissions problem I tried setting rights to 777 No. Not even once. –  adaptr Jul 24 '12 at 9:49
Yes, writing the stuff to /tmp/smbchat.txt is working when i invoke it manually. I set the permissions of the script to 777. What is not working is that there is nothing being written to the log on password change. But this is rather a comment, then an answer anyways. –  Zulakis Jul 24 '12 at 11:37
You haven't asked an answerable question yet. –  adaptr Jul 24 '12 at 12:25

Your Answer


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

Browse other questions tagged or ask your own question.