First of all, there are no passwords in /etc/passwd. They were moved to the secure /etc/shadow file a long time ago.
Second, you do not edit the password file directly. The passwords are stored as hashes, and unless you know how to compute an MD5 or SHA1 hash in your head, you'll need to use passwd.
Third, using passwd isn't going to work for Windows clients accessing Samba shares. The hash algorithm used by Windows is incompatible with the one used on Linux systems, so Samba actually stores a separate hash for Windows clients. This hash is stored in a database file, and you can change the password (and update the hash) with the smbpasswd command.
Finally, all this assumes you're running Samba in standalone mode and not as an Active Directory Domain Controller. If Samba is a DC, all the above is moot since the AD users do not exist in the local Linux user database. You will then need to use samba-tool user setpassword <username> instead.
|