Linux – Permission on a symlinked directory in a Samba share

linuxsambaUbuntu

I have a Samba share of my home directory set up as described here. On my Windows box I can access the share, open files and write to them. The server I am connecting to is an Ubuntu 12.04 VM running on Virtualbox.

In my home directory I have symlinked /var/www to ~/www:

charlesr@hicks:~$ ls -lad www
lrwxrwxrwx 1 charlesr charlesr 8 Jul 16 18:45 www -> /var/www

Even though the symlink is owned by me (charlesr), I cannot access it via Windows:

Windows network error

I've checked permissions on /var/www and that directory is part of the www-data group, which I am a part of:

charlesr@hicks:~$ ls -lad /var/www
drwxrwsr-x 3 root www-data 4096 Jul 16 18:13 /var/www

charlesr@hicks:~$ grep www-data /etc/group
www-data:x:33:charlesr

So what am I missing here? Why can't I access this symlinked directory that my user has permission to read and write to? I'm new to Samba so I'm hoping it's something obvious.

Best Answer

Samba doesn't like symlinks for security reasons, and won't follow them unless you force it. Try adding

wide links = yes
unix extensions = no
follow symlinks = yes

to your smb.conf [GLOBAL] section and restart Samba. follow symlinks should already default to yes, but it won't hurt to set it again.