Samba and User Acount Passwords
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.
Related videos on Youtube
Theo Carper
Phillies, Flyers, Eagles, Tech & video game junkie.
Updated on September 18, 2022Comments
-
Theo Carper over 1 year
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.
-
Theo Carper almost 12 yearsWell not so fast. So I have the security = user uncommented, same with the unix password sync but when I go to add a user, it keeps asking for a password. Am I to enter my login password here?
-
jpetersen almost 12 yearsIf you add a user to the system (
sudo adduser kevin
for example) you need to give them a password as well, this is the password that will be required for that user to access a share. Change password withsudo passwd kevin
. Does that help? -
Theo Carper almost 12 yearsWhat if I already have a user added to the system, in this case "Family". Samba is up and running and while trying to connect via my Mac or Win7 box, once I enter my login credentials for "Family", a message pops up saying invalid username or I don't have access. I'm guessing I am missing something within the config somewhere.
-
jpetersen almost 12 yearsAre you restarting the samba services after making changes to the config file? Do you have
valid users = Family
in smb.conf under the share section? If your still having trouble it might be best to start another question with more detail: smbd error messages that pop up in/var/log/auth.log
, and how you set up samba possibly with the dump of your config file as welltestparm /etc/samba/smb.conf
....(which also tests smb.conf syntax). -
Theo Carper almost 12 yearsOk, well this might sound odd, but how do I create a unix username? I'm currently logged into ubuntu with the "family" username, with a password of 12345. I ran the following command to see what users have been added:
sudo pdbedit -L -v
and the only user added is "nobody". So should I runsudo smbpasswd -a family
? If so, what password should I enter? Should I enter 12345, same as my logon?