SUSE Support

Here When You Need Us

Samba and UNIX password synchronization

This document (7001120) is provided subject to the disclaimer at the end of this document.


SUSE Linux Enterprise Server 10 Support Pack 1


Setting the password for a Samba enabled user requires the passwd and smbpasswd programs.  If you only change the password with one of these then the passwords are out of sync.


In the [global] section of the etc/samba/smb.conf add the following lines and save the file.


unix password sync = yes


passwd program = /usr/bin/passwd %u

passwd chat = "*New Password:*" %n\n "*Reenter New Password:*" %n\n "*Password changed.*"

Now restart Samba (rcsmb restart)

Now set a users password by changing to that user (su<username>) and typing smbpasswd <username><enter>.  Follow the smbpasswd chat to change the Samba password for this user.  In the background smbpasswd will launch the passwd program specified and follow the passwd chat to change the UNIX password for that user.

The passwd chat line must be exactly what the password program (in this case /usr/bin/passwd) returns when changing a password using that program.

The passwd chat line tells Samba what to expect so that it knows how to respond.

You can see what the chat will be by simply using the specified password program to manually change a password. 

passwd testuser <enter> will generate the following chat,"New Password:" followed by "Reenter New Password:" and finally "Password changed."


This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7001120
  • Creation Date: 07-Aug-2008
  • Modified Date:10-Mar-2021
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.