How do you make samba follow symlink outside the shared path
This is Ubuntu server 10.04 64 and samba 3.4.7.
I have a shared directory
/home/mit/shareand another one
/home/tempthat I link into the shared one:
ln -s /home/temp /home/mit/share/temp
But on windows, after using internet, I cannot open
S:/temp, but on Linux it is possible to access
This works if I link directories inside
/home/mit/share/temp, so I guess samba is restricting to jump with a link outside/above the shared directory.
See also this question titled Ubuntu + latest samba version, symlinks no longer work on share mounted in Windows.
It seems best to put
unix extensions = nointo the global section and
follow symlinks = yesand
wide links = yesonly into the shares section, where you really need it.
unix extensionflag has to live in the global section and not in the individual shares sections. But for security reasons it is better to use the other options only where you need it, and not globally.
[global] unix extensions = no [share] follow symlinks = yes wide links = yes
Note: If you're using a newer version of samba the following may work for you instead:
[global] allow insecure wide links = yes [share] follow symlinks = yes wide links = yes
wide linksflags: https://www.samba.org/samba/docs/using_samba/ch08.html#samba2-CHP-8-TABLE-1
See also the explanation at the end of the question above why this is a good solution.
In case, somebody else struggles with all those commentary obfuscating this rather short file: copy to a backup, and re-create filtered: 1: `cp /etc/samba/smb.conf /etc/samba/smb.conf.bak` 2: `grep -o '^[^#;]*' smb.conf.bak >smb.conf`