Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I keep all my Photos on my Share: //COMPUTERNAME/Photos

In the Photos share, it contains all the years folders follow by album name, example:

//COMPUTERNAME/Photos/2012/New York/
//COMPUTERNAME/Photos/2011/Party Night/

Only I have access to Photos share with username and password, it is not accessible by anyone.

However, I want to share a few photos albums for my family but I don't want them to have access to the Photos share.

I can create a share called //COMPUTERNAME/PhotosShare/ but I don't want to copy a few photos albums from Photos share.

In the //COMPUTERNAME/PhotosShare/ share I want something like this:

//COMPUTERNAME/PhotosShare/2012 New York link with //COMPUTERNAME/Photos/2012/New York/

Is it possible to use ln command? I don't think that going to work due to user permission access on Samba.

What is the solution?

share|improve this question

migrated from serverfault.com Jun 8 '13 at 1:13

This question came from our site for system and network administrators.

up vote 2 down vote accepted

I think you could accomplish what you want by setting up samba as follows. First you're going to want to use Samba's user security mode (security = user) in your smb.conf file.

Next you'll want to setup a user called smbshare in your smbpasswd file. This user will only exist within Samba, so make sure it doesn't exist within the Linux side (i.e. /etc/passwd).

Next map this Samba user in the smbusers file so that it maps to your Linux account.

# unix acct. = samba acct.
myuser = smbshareuser

This will give this Samba user access as you to the file system.

Finally you'll want to setup a directory with the links to the different photo shares and add this directory as a share within Samba's smb.conf file.

  comment = My Shared Photos
  path = /path/to/dir/with/links
  browseable = yes
  read only = yes
  valid users = smbshareuser

example links directory

$ ll /path/to/dir/with/links
total 0
lrwxrwxrwx 1 root root 49 Jun  8 04:01 album1 -> /path/to/album/album1
lrwxrwxrwx 1 root root 58 Jun  8 04:00 album2 -> /path/to/album/album2

After making these above changes make sure to restart the samba services (smbd & nmbd).

share|improve this answer
Thanks @slm - you have explained how to share a single directory from a photo share. I was talking about linking a few folders in a PhotosShare from a photos share – I'll-Be-Back Jun 8 '13 at 7:53
No the directory /path/to/dir/with/links would be a directory with links to the various folders that you want to share with others. – slm Jun 8 '13 at 7:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.