This command updates the passwords that is needed by a local Samba server for authentication purposes. As such, it is only needed when the server does not specify “domain” or other remote means for authentication purposes.
The use of smbpasswd is very similar to passwd. However, smbpasswd does not store password in /etc/shadow. In fact, smbpasswd does not even specify where passwords (encrypted) are stored. This is because smbpasswd communicates with the local Samba server, and it is up to the Samba server to decide how passwords are stored. This implies that a local Samba server must be active in order for smbpasswd to work.
The actual location to store passwords is specified by the passdb backend option in smb.conf. This option has a default that is distribution dependent. In Debian, the location is /var/lib/samba/passdb.tdb. Unlike /etc/shadow, passdb.tdb is not a text file.
smbpasswd does relate to passwd. It can be used to add Samba recognized accounts only if these accounts already exist in passwd.
If a Samba server specifies security = user, then the root user must use smbpasswd to assign passwords to local users who will be authenticated against by remote clients. It is also important to note that the Samba password and local password (maintained by passwd) of a user do not need to match.
Once a user has an entry in the Sambe password database, he/she can update the password using smbpasswd.