I am setting up a home server with file sharing using Samba. It has XUbuntu 15.10.  

Samba uses passwords specified in `shares-admin` by default. However, I want Samba to use users from `/etc/passwd` and passwords from `/etc/shadow`.  

I managed to find many manuals on Google which are using `/etc/pam.d/samba`, but I do not understand them and I do not know if this is a good way to do this.

Is it correct to do it this way? If yes, then what should I write in `/etc/pam.d/samba`? If not, what is the correct way?