# Samba and Unix Password Sync [solved]

## gcrew

Has anyone successfully used Unix Password Sync in Samba?

I uncommented the "unix password sync = Yes" and "pam password change = yes" lines in smb.conf.

passwd seems to change my system password, but not my samba password.

smbpasswd changes my samba password, but not my system password.

Thanks.

GeoffLast edited by gcrew on Thu Mar 03, 2005 3:56 am; edited 1 time in total

----------

## Will Scarlet

From the man page of smb.conf for unix password sync:

 *Quote:*   

> unix password sync (G)
> 
> This boolean parameter controls whether Samba attempts to synchronize the UNIX password with the SMB password when the encrypted SMB password in the smbpasswd file is changed. If this is set to yes the program specified in the passwd programparameter is called AS ROOT - to allow the new UNIX password to be set without access to the old UNIX password (as the SMB password change code has no access to the old password cleartext, only the new).
> 
> Default: unix password sync = no 

 

 *Quote:*   

> passwd program (G)
> 
> The name of a program that can be used to set UNIX user passwords. Any occurrences of %u will be replaced with the user name. The user name is checked for existence before calling the password changing program.
> 
> Also note that many passwd programs insist in reasonable passwords, such as a minimum length, or the inclusion of mixed case chars and digits. This can pose a problem as some clients (such as Windows for Workgroups) uppercase the password before sending it.
> ...

 

So it appears that you were on the right rode, you just needed a little more information.  Also you assumption of when you change your Unix password that it will change your smb password is incorrect it only works the other way.

Hope this helps... :Wink: 

----------

## gcrew

I think I've solved my problem.

The solution came partially from the following link:

http://www.oreilly.com/catalog/samba/chapter/book/ch06_04.html

Firstly, my passwd program path incorrectly was /usr/bin/passwd so I changed it to:

```
passwd program = /bin/passwd %u
```

Also my passwd chat format was wrong:

Didn't work:

```
passwd chat = *New*UNIX*password* %n\n *Re*ype*new*UNIX*password* %n\n \

  *passwd:*all*authentication*tokens*updated*successfully*
```

Works:

```
passwd chat = *New*UNIX*password* %n\n *Re*ype*new*UNIX*password* %n\n \

  *passwd:*password*updated*successfully*
```

The chat needs to be the exact output of passwd.  I'm surprised the default values aren't closer to the real values I needed.  Anyway, now it works.  smbpasswd changes both smb and system password.  passwd changes just system.

Geoff

----------

## Atomikramp

i have the same problem, i tried to fix it the same way u did but it still doesn't work...

o well...

whenever from a windows client i try to change a samba user password the system password is changed, a permission rror is returned from the win workstation and the samba password doesn't change at all....

any suggestion??

thnx very much

----------

