2

I am facing the problem with permission on cifs shares. I have a Lubuntu netbook, a Win7 notebook and a QNAP NAS.

I mounted shares on the lubuntu netbook in the fstab:

//192.168.2.49/nasdata /home/NASDATA cifs username=nilli,password=xxx 0 0
//192.168.2.21/Users /home/WIN7 cifs username=nilli,password=yyy 0 0

If I try to write as a user on these shares I get an error that it is not permitted. If I mount the 'Public' folders on the QNAP NAS or the WIN7 notebook and try to write as root, it works.

Now I want to write as a normal user ( not as root ) and not in the 'Public'-folders, but in any normal folder, what do I have to do ?

Thanks a lot for the help !!!

  • which computer is sharing those folders? – Edward Torvalds Jan 27 '16 at 18:51
  • shared folders are on my Win7 notebook and on my Qnap NAS ( Linux ) – nilli Jan 28 '16 at 18:02
  • add these options after password, uid=1000,gid=1000. change 1000 to the user id of nilli accordingly. do this in both lines – Edward Torvalds Jan 28 '16 at 18:13
  • yes, that works on the NAS ! Thanks !! But unfortunately not on Win7 ... – nilli Jan 28 '16 at 18:44
  • look up on web if you can set/change permissions on that share from windows7 – Edward Torvalds Jan 28 '16 at 18:53
2

You'll have to setup an effective user and or effective group as part of you mount options. Make sure the user or group has the type of access you want to provide for for that share.

You can also specify the type of file mask you want to be associated with the files and folders that user creates.

This is an example to add to your options:

uid=[username/ID],gid=[groupname/ID),file_mode=0660,dir_mode=0775

So you would effectively have:

//192.168.2.49/nasdata /home/NASDATA cifs username=nilli,password=xxx,uid=[username/ID],gid=[groupname/ID),file_mode=0660,dir_mode=0775 0 0

Change the bracket [entry] to either the desired username/groupname or uid/gid.

  • Yes, thanks ! That works on the NAS. But unfortunately not on Win7 ... – nilli Jan 28 '16 at 18:49
  • @nilli Add rw to the options. An example is included to the update of my answer. I may have to setup a windows machine for additional test if you continue to have the same problem. – L. D. James Jan 28 '16 at 23:09
  • @James : Ok, my trouble were the premissions on th win7 machine. Now it works perfekt. Thanks a lot !! – nilli Jan 30 '16 at 8:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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