0

I like to make a read only share for a user whom has access to several root folders in my fileserver. I don't want to create a bunch of shares for each folder, can I somehow add multiple paths in smb.conf?

Eg:

path=/folder1, /folder2

Edit: Without using Symlinks. I understand the Unix FS, but don't want to clutter things up with Symlink, if I have to, I will, but I'd prefer to use path= as its seems simpler/better.

  • Look here: https://unix.stackexchange.com/questions/5120/how-do-you-make-samba-follow-symlink-outside-the-shared-path – davidbaumann Mar 20 '18 at 09:33
  • I'm not looking to use symlinks, I considered it, but I'd rather create separate SMB shares vs symlinks. – FreeSoftwareServers Mar 20 '18 at 09:37
  • The documentation is pretty clear: path points to "a directory", with no mention of more than one. Making a directory with a few symlinks is likely easier for future management of the share anyways, as you don't have to always edit and reload the configuration file. – ErikF Mar 20 '18 at 09:45
  • @ErikF I believe you are correct, so the answer to my question is NO, use symlinks and follow symlinks = yes. You can write up an Answer if you want – FreeSoftwareServers Mar 20 '18 at 09:46

1 Answers1

1

The documentation is pretty clear:

path (S)

This parameter specifies a directory to which the user of the service is to be given access. [...]

The share path points to "a directory", with no mention of more than one. I can think of several reasons for this: first, it's in keeping with how Unix treats filesystems in general (for example, NFS shares behave the same way); and second, it's difficult to come up with a good way to merge directories in general without potential filename collisions.

Making a share that points to a directory with a few symlinks is likely easier for future management of the share anyways, as you don't have to always edit and reload the configuration file.

ErikF
  • 4,042
  • It just seems a simple option to add comma separated paths, infact, I noticed (S), What would that be for? But, I suspect this is correct regardless. – FreeSoftwareServers Mar 20 '18 at 09:58
  • 1
    (S) means that the directive is for shares only; (G) means it's a [global] directive. – ErikF Mar 20 '18 at 09:59