1

I'm experimenting with Samba shares at home and I'm trying to understand how symbolic links work.
I have a few network shares on a couple of machines that run a mix of Windows and Ubuntu or Debian distros.
I'm trying to understand a few things:

  • is it possible to allow for the creation of symbolic links (from any client) inside the shares and across shares but not outside shared paths? For example if I have /srv/share1 and /srv/share2 would it be possible to link:

    /srv/share1/link -> /srv/share1/file
    

    and

    /srv/share2/link -> /srv/share1/file
    

    but not any file outside these 2 directories?

  • is it possible to make symlinks "transparent" on any client or specific clients when mounting the shares? Are there specific options I should use when mounting them on other machines to see links as such?
    Right now mounting them using cifs shows symlinks as it was a normal files (I didn't set any options using the command beside authentication).
    This answer: Deleting Ubuntu folder symlink deletes target folder's contents when done via OSX & Samba seems to support this behaviour.

  • I'd like to get a clearer understanding on which are the pros and cons of various options used to manage links; in particular which are the advantages and disadvantages of:

    [global]
    allow insecure wide links = Yes
    unix extensions = Yes
    wide links = Yes
    

    instead of:

    [global]
    unix extensions = No  # Does this imply UNIX clients cannot create symlinks?
    wide links = Yes
    

    besides the obvious security problem related to allow insecure wide links being turned on.
    The above config is from: https://unix.stackexchange.com/q/5120/181086

A partial answer is given here: creating symbolic links on networked drive but it's related to Windows.
Other answers such as: Ubuntu + latest samba version, symlinks no longer work on share mounted in windows
Creating a Symlink in an NTFS share
aren't really recent and don't go in-depth in the reasons why it does or doesn't work.
Finally this one I didn't understand Samba Linux shares -- Why won't windows machines display/follow symbolic links?.

  • This question as asked is a bit too broad. The first thing you need to understand is that links are a Filesystem concept, and whilie Samba does present a set of virtualized filesystem semantics to clients, it sits atop the real filesystem implementation on the server. Ultimately, that means that the difference between creating links on the native filesystem, vs simply dereferencing links them for browsing and access are somewhat differant problems. I've never seen a mechanism for making symlinks over shares, but I've commony set up symlinks within shared directories for clients to access. – Frank Thomas May 13 '17 at 21:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.