Click to See Complete Forum and Search --> : Sync smbpasswd to /etc/shadow


Phaete
12-28-2005, 06:22 PM
I haven't found here or Google whether syncing the smbpasswd file can be with /etc/shadow rather than /etc/passwd. Anyone know if the cat /etc/passwd | mksmbpasswd.sh > /etc/samba/smbpasswd command is required and will successfully create a Samba password file on a server using shadow passwords??

Phaete
01-17-2006, 11:15 AM
Just renewing the post since this is still an issue. Samba help seems to indicate that a smb.conf setting for

unix password sync = Yes

would keep user samba passwords in sync with their linux password (either passwd or shadow), but we are not experiencing this. I even went so far as to pwunconv, then cat /etc/passwd | mksmbpasswd.sh > /etc/samba/smbpasswd and back to pwconv, but the resultant smbpasswd file simply doesn't have valid passwords. All named users have records similar to the following after the mksmbpasswd shell is run:

corbins:536:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXX:[U ]:LCT-00000000:

In this scenario, users can't even run smbpasswd themselves to change their own Samba password since it fails the initial 'current password' challenge and I have to make a change for them as root.

Any ideas?

Icarus
01-17-2006, 11:50 AM
Have you added a password script in the smb.conf for the sync'ing?
This is pretty basic and you can find much better examples with http://google.com/linux

passwd program = /usr/bin/passwd %u
passwd chat = *password* %n\n \
*password* %n\n \
*successful*

Also check the samba logs, the errors are usually printed there and have a tendency to really help out with samba problems ;)

Phaete
01-18-2006, 01:32 PM
This is how we have the smb.conf file setup:

[root@ssi04 rfxtest]# grep passw /etc/samba/smb.conf
encrypt passwords = Yes
min passwd length = 5
null passwords = No
smb passwd file = /etc/samba/smbpasswd
pam password change = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *New*password* %n\n *Retype*new*password* %n\n *passwd:*all*authentication*tokens*updated*success fully*
passwd chat debug = No
password level = 0
unix password sync = Yes