Symbolic link permission denied, shared folder over cifs

10,056

You can't create symlinks on CIFS/samba shares. Symbolic links are intrinsic parts of the filesystem where the files are stored (aka the remote physical disk) and you can't modify the inodes of those unless you have direct access to the drive, which you don't due the characteristics of the CIFS protocol.

Simply put, you can't unless you are in the remote system itself.

There's an extension that would allow you to create symlinks from the remote server, but both the server must support it and you must mount the share which such option:

sfu

When the CIFS Unix Extensions are not negotiated, attempt to create device files and fifos in a format compatible with Services for Unix (SFU). In addition retrieve bits 10-12 of the mode via the SETFILEBITS extended attribute (as SFU does). In the future the bottom 9 bits of the mode mode also will be emulated using queries of the security descriptor (ACL). [NB: requires version 1.39 or later of the CIFS VFS. To recognize symlinks and be able to create symlinks in an SFU interoperable form requires version 1.40 or later of the CIFS VFS kernel module.

Your user would also need permission in the server side to create symlinks.

Share:
10,056

Related videos on Youtube

user244501
Author by

user244501

Updated on September 18, 2022

Comments

  • user244501
    user244501 over 1 year

    I have synology rack , and im using one folder from my ubuntu 12.04. but I wont be able to create a symbolic link on mounted folder, getting permission denied error, below is my fstab entry

    #//1.1.1.11/sologs  /nsm  cifs uid=1001,gid=1001,username=admin,password=123456,iocharset=utf8,sec=ntlm  0  0
    

    I tried,

    sudo ln -s /test /nsm
    

    Error,

    ln: failed to create symbolic link `/nsm/test': Permission denied
    
    • web.learner
      web.learner about 10 years
      What are the permissions of your rack?
    • user244501
      user244501 about 10 years
      gave full permission, i can do everything except symbolic link creation,
  • krb686
    krb686 over 7 years
    While it seems like this probably has something to do with the issue, it certainly isn't the whole story. I'm having this exact issue with a shared folder from Win10 that is mounted in CentOS 7.1, and my cifs module is 2.03, and adding -o sfu doesn't fix it
  • Sapnesh Naik
    Sapnesh Naik over 2 years
    Does this hold true for Hardlinks as well?
  • Braiam
    Braiam over 2 years
    @SapneshNaik my gut feeling would tell me that yes, but I don't really know.