Samba and User Acount Passwords

Is it possible to tie your login password to your samba password?

Ideally every 30 days, users need to change their passwords to login into the machine and if its possible, when they update their password, it'll also update the samba password.


Solution 1:

I believe Samba is configured like that by default, here are the relevant lines in smb.conf:

# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
# in the samba-doc package for details.
    security = user

...

# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
    unix password sync = yes

More info on these options and more here. Hope that helps.

EDIT:

The first time you add a linux user (adduser) you need to add them to smbpasswd as well.

sudo smbpasswd -a <user>

when prompted for a password use the same password you used with adduser. After this the smb password should be updated automatically when you change the linux password with sudo passwd <user>

Solution 2:

To have your updated unix password also be your new samba password, you'll have to install the libpam-smbpass package.