I'm working on sharing a user's home folder using the username and password of the user's lLnux account. I noticed that home folder sharing is quite easy as I just need to change the smb.conf file to enable it. However I can't seem to login anyway.

It seems that Samba keeps its own records of username and passwords. Is there a way that I can map/sync the Linux users' usernames and passwords automatically to Samba? The end result should be that whenever I add a new user or a user changes his/her Linux login password, Samba automatically changes its password as well.

migrated from stackoverflow.com Sep 8 '11 at 8:02

This question came from our site for professional and enthusiast programmers.

  • How did you delete the user? Did you delete the user folder along with the account? Have you checked if /home/USER still exists? Normally deleting an account should not delete user's files unless explicitly requested. If you have also deleted the files, well everything depends on how you did it. I guess you were root when you deleted the user, right? I would first check root's trash, it is very unlikely that you will find anything there, but I guess it is worth trying. – mirix Sep 7 '11 at 14:08
  • In the worst case scenarios: cyberciti.biz/tips/… or linux.com/news/enterprise/storage/… – mirix Sep 7 '11 at 14:09
  • I got confused about the above comments, are they related to my post at all?? – Sheng Rong Sep 7 '11 at 17:53

You might want to have a look at pam_smbpass to sync passwords automatically. However, be aware that existing passwords cannot be converted due to hash inconsistencies.

Basically, this inconvenience is because Windows uses some obscure password hash function on the client side, and UNIX boxes normally don't keep passwords in these obscure hashes. So Samba has to build its own DB.

  • 1
    Thanks for your reply. It did work! In case someone else has the problem as well, here's an article for pam_smbpass configurations if you install samba via compiling the src from scratch jaka.kubje.org/infodump/… however, if u are using ubuntu, simply do: sudo apt-get install libpam_smbpass, it configures automatically for you. – Sheng Rong Sep 7 '11 at 17:52
  • pam_smbpass appears to be deprecated – alex.forencich Sep 18 '17 at 6:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy