Samba's force user
configuration parameter is useful as it allows multiple users to access a share while performing all file operations as a single specified user.
Is it possible however to use the force user
parameter on a per-directory basis?
I have a number of shares which are accessed by a few different users and on various devices. Recently I created a shared named "OmniShare" which allows access to files in all shares while only having to map a single drive in Windows. I use this on my main computer. It's configured like this:
[omnishare]
path = /home/redacted/OmniShare
valid users = redacted
read only = no
browseable = no
hosts allow = 192.168.1.20
/home/redacted/OmniShare
is simply a directory containing symbolic links to the specified path
for the other shares. Since some shares are accessed by users other than redacted
, I have refrained from writing through the OmniShare to prevent others having issues reading and modifying files.
Is it possible to use the force user
parameter so that file operations are performed by a specified user based on the symbolically linked directory?
Example:
File operations in /home/redacted/OmniShare/user1
are performed by user1
rather than redacted
.
File operations in /home/redacted/OmniShare/user2
are performed by user2
rather than redacted
.
Or, perhaps, there's a better way to do this altogether?