1

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?

1 Answer 1

2

It sounds like your OmniShare is acting a little bit like Microsoft's Distributed Filesystem Namespaces in function, though not in implementation. DFS Namespaces allows you to present disparate shares as a single unified share.

I think you'd do well to have a look at: https://wiki.samba.org/index.php/DFS

Samba can "knit" together shares much like DFS Namespaces. Rater than using symbolic links to filesystem locations you'll use symbolic links to SMB shares. I would expect the force user functionality of the destination share to be observed by Samba (and I wouldn't set any force user on the DFS root).

1
  • Thanks. Having read the pages you've linked and some more pages in Samba's documentation, this seems to be exactly what I'm after.
    – Torvero
    Oct 27, 2014 at 22:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .