[Samba] Controlling [homes] path to obey /etc/passwd while using winbind

frank picabia fpicabia at gmail.com
Wed May 25 13:46:42 UTC 2022

On Tue, May 24, 2022 at 5:23 PM Rowland Penny via samba <
samba at lists.samba.org> wrote:

> If you just require authentication, then use sssd, but if you require
> any shares (which includes home directories), then you need Samba with
> winbind and all that entails, among which is that you do not have users
> in /etc/passwd and AD.

This is how we have used samba for over 2 decades.  Users were
in /etc/passwd and AD, and [homes] worked based on the local home directory
in /etc/passwd.  I believe %H was populated based on the /etc/passwd
value (or homedir found in getent passwd) in older Samba versions.

> If all your users that log into this Samba server use the same homedir
> path, then add 'template homedir = /path/to/users_dir/%U' and change
> 'valid users = %U' in '[homes]' to 'valid users = %S', this will unsure
> that only the user will be able to get into their own homedir.

Yes, I considered building the path that way.  Unfortunately the directory
isn't flat and the year of student registration is part of the homedir path
on the Comp Sci student server.  I think we're going to have to discontinue
and ask them to use sftp.  They should be able to manage that.

Most of our samba share use on campus is not homedir oriented and it
will work okay.

Thanks for the answers.

More information about the samba mailing list