Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I set up a generally working samba server on a Linux machine like this:

useradd -g users netshareuser

passwd netshareuser

smbpasswd -a netshareuser

(passwords are the same)

mkdir /net/share

chown -R root:users /net/share

chmod -R g+rwxs /net/share

setfacl -R -m default:user::rwx,default:group::rwx,default:mask::rwx,default:other::--- /net/share

/etc/samba/smb.conf:

    [global]
    workgroup = workgroup
    server string = server
    security = user
    hosts allow = 192.168. 127.
    load printers = no
    log file = /var/log/samba/%m.log
    max log size = 50
    dns proxy = no
    printing = bsd
    printcap name = /dev/null
    disable spoolss = yes

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

    [share]
    comment = Directory containing shared files
    path = /net/share
    valid users = netshareuser
    read only = yes

rc.d restart samba

From a Windows (7) machine, "netshareuser" can access this share, read files and directories. However, If I create a symlink ln -s /some/directory/ /net/share/nameOfSymlink, the same Windows machine would not even display it.

Questions:

  1. What do I have to do, to get Linux symlinks in that share to work on windows machines and is that even possible? UPDATE: This question has been answered by ultrasawblade! The problem were wrong permissions on /some/directory

  2. Is there some way of sharing files with samba, that does not require to change file permissions? I mean a way, where you can share any file on your linux system to anyone on your network but without changing this file's permissions. What I want is: Tag a file as shared to "netshareuser", without changing the permissions of that file.

Thanks in advance for any suggestions!

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Looks like you have the wide links setting to yes, which is what got me recently.

It's probably due to the permissions on /some/directory, following your example above.

If you don't want to change the file permissions, then you need to tell Samba to use a different local user for that share. That's really your only two options.

I think the force user and force group options is what you want. You will not have an optimum security situation if you force user to root, but it may be what you are looking for.

share|improve this answer
    
I think you are correct. I tried: mkdir /net/share/d; ln -s /net/share/d symlink and this worked. So I consider the first question answered! –  MCH Aug 25 '12 at 17:46
    
Well, the answer to your second question is no, unless you tell Samba to use a different local user or map the Samba user to a different unix user. –  ultrasawblade Aug 25 '12 at 18:37
    
I know this is a fairly old question, but its worth the try: I am having this problem too. I am trying to link from one share to another, with two different users. All my folders and files shared by samba have 755 permissions. When you say that permissions are to blame, what do you mean? Is there some requirement that the user should have access either through owner or group? –  Martin Nielsen Jan 24 '13 at 12:39

Your Answer

 
discard

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.