O
O
OSBoy2019-01-07 19:48:19
linux
OSBoy, 2019-01-07 19:48:19

Why does Samba prevent a user from writing files to the home directory without permission for the group to write?

Started learning Samba. Installed: version 2:4.5.12+dfsg-2+deb9u4 on Debian 9.
Set up a minimal config for user access to the home directory:

[global]
   workgroup = WORKGROUP
   dns proxy = no
   log file = /var/log/samba/log.%m
   max log size = 1000
   syslog = 0
   panic action = /usr/share/samba/panic-action %d
   server role = standalone server
   passdb backend = tdbsam
   obey pam restrictions = yes
   unix password sync = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
   pam password change = yes
   map to guest = bad user
   usershare allow guests = yes
[homes]
   comment = Home Directories
   browseable = no
   read only = no
   create mask = 0644
   directory mask = 0755
   valid users = %S
   path = /home/%S/samba

The essence of the question is this: why does Samba not allow the user to write files to the home directory (and subdirectories) if it has permissions, for example, 755? At the same time, if you set the rights, for example, 775, then the files are recorded normally! That is, in order to allow the owner to write, you have to give write access to his group!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
maniac_by, 2019-01-08
@maniac_by

The essence of the question is this: why does Samba not allow the user to write files to the home directory (and subdirectories) if it has permissions, for example, 755?

Because the architecture of Linux does not allow you to use a user without a group. By default, the group with the same name is assigned to the user along with the user. If you want to create balls for each user separately, then assign each ball to a user group. Just when you create a user, generate an additional unique group for the balls. https://help.ubuntu.ru/wiki/users_and_groups
As a result, you will have only two groups for each share: Named user with management rights, and general (if necessary) with read rights.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question