# FreeBSD 10.0 Samba36 unix password sync fail



## chryschool (Oct 1, 2014)

Hi all,

I have a SAMBA36 (standard install with /usr/ports/net/samba36) on my Freebsd FreeBSD 10.0-RELEASE #0 and I can't synchronize the TDBSAM with master.passwd.
In my smb.conf I have:

```
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Changing*local*password*for* %u\n *New*Password:* %n\n *Retype*New*Password:* %n\n
```
*T*he d*ae*mons smdb and nmdb are ok.
Changing the password with `smbpasswd user` is ok on Samba but not with my system.

Can you help me please  :q


----------



## varda (Oct 13, 2014)

Try to remove:

```
*Changing*local*password*for* %u\n
```
since you do not need to expect promt for login and then send it. Only password requested an supplied twice.

Report here if it helps.

Also you can make some kind of wrapper (call this file "passwd.sh"):

```
#!/bin/sh
/usr/bin/passwd -l $1
echo "Password Changed"
```

Then alter smb.conf accordingly:

```
unix password sync = Yes
passwd program = /path/to/passwd.sh %u
passwd chat = *Password* %n\n *Password* %n\n *Changed*
```

For a mission critical production system you may want to put more error checking into this shell script.


----------

