Prevent directory moving and renaming on samba share
by mfoley from LinuxQuestions.org on (#6GPS8)
I have a Samba shared network drive. It's smb.conf attributes are:
Code:readonly = no
locking = yes
public = yes
printable = no
create mask = 0660
force user = user
force group = group
force create mode = 0660
directory mask = 2771This important bit here is that the user.group is forced to (obfuscated) user.group. The Windows clients access this mapped drive as that user and group.
All that works fine in that all Windows users can read/update any files and folders on this share.
However, I now want some of the directories to have unchangeable names since certain paths get stored in the database. For example I need:
Code:drwxrwx--x 14 user group 4096 2022-12-22 10:12 Accts\ Payable\ -\ ofc/to never allow users to change its name. Other solutions, such as changing the owner to root.root won't work because the entire volume is shared as owner user.group.
Can this be done?
Code:readonly = no
locking = yes
public = yes
printable = no
create mask = 0660
force user = user
force group = group
force create mode = 0660
directory mask = 2771This important bit here is that the user.group is forced to (obfuscated) user.group. The Windows clients access this mapped drive as that user and group.
All that works fine in that all Windows users can read/update any files and folders on this share.
However, I now want some of the directories to have unchangeable names since certain paths get stored in the database. For example I need:
Code:drwxrwx--x 14 user group 4096 2022-12-22 10:12 Accts\ Payable\ -\ ofc/to never allow users to change its name. Other solutions, such as changing the owner to root.root won't work because the entire volume is shared as owner user.group.
Can this be done?