User mapping in Samba

Issues related to applications and software problems
Post Reply
simon@bp
Posts: 44
Joined: 2014/07/31 20:00:37

User mapping in Samba

Post by simon@bp » 2020/08/05 23:05:34

I have a network with a Samba server (Samba 4, but running as an old NT-style domain), Windows and Linux clients.

The Windows clients need to be able to read and write to filesystems on the Linux client.

This was all working with (I am ashamed to say) CentOS 5. However, after an update to CentOS7, things don't seem to work the way they used to. In order to get smb working, I had to change "security = server" to "security = domain", install winbind and I then joined the Linux client to the domain.

What I see now is that files created by the Windows clients show owned by: "<DOMAIN>\user", with an associated UID that has a very high number.

Is there any way to have the Windows client access map to just "user", with its Linux UID?

poky
Posts: 108
Joined: 2013/03/27 12:18:03

Re: User mapping in Samba

Post by poky » 2020/08/23 09:46:56

I have CentOS 7 with Samba 4 and "security = user".
I have linux users from sambauser01 to sambauser099.
In smb.conf I have:
username map = /etc/samba/usernamemap

My file usernamemap:
# group static
sambauser01 = john
sambauser02 = george
sambauser03 = Rosanna
# group thermal
#..........
#..........

So, when new admin renamed user "john" to user "jh55g" for "security by obscurity", not problem... :D

BShT
Posts: 585
Joined: 2019/10/09 12:31:40

Re: User mapping in Samba

Post by BShT » 2020/08/23 10:25:46

this is the normal behavior if join domain

try to:

force create mode = 0777
force directory mode = 0777
force user = nobody
force group = nobody
valid users = @"%D\YourADGroup"

Post Reply