If you have a linux samba share and some of your directories are not accessible or are treated as files, then you might have a situation where those directories are actually symbolic (soft) links and you haven’t configured samba to follow symbolic links.

Symbolic links

This handy tip is only to fix a samba problem with symbolic links problem.
So the first thing that needs to be done is to determine that the directory you are trying to access is a symbolic link

Log into your linux/unix or mac machine and get the terminal up.

Do the ls -l command on the parent of the directory of the directory in question.
So for example if the directory you have problem access is /home/superuser/myfiles then you need to do an ls -l in the directory /home/superuser

$ cd /home/superuser
$ ls -l
-rw-------    1 superuser    staff     9185280 May 19 21:58 latestTips.tar
lrwxrwxrwx    1 superuser    staff          38 Oct 23  2006 files -> /web/files
-rw-r--r--    1 superuser    staff    25357023 Aug 24  2009 someOtherRandomFile.pdf

From the example above, files is a symbolic link to /web/files

To fix the samba problem with accessing symbolic links, you will need to modify the samba config file, smb.conf which is normally at /etc/samba/smb.conf and add the following lines to the [global] section in that file.

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

Once that is done, restart samba (in ubuntu the command is $ sudo /etc/init.d/samba restart ) and presto, the symbolic links should now be accessible from samba!

Edwin is the founder and editor of Little Handy Tips and Wollongong Fitness. He is also the developer for the Google Custom Search WordPress plugin and Custom About Author WordPress plugin. Find out more about him here.