Ubuntu – Cifs share permissions

cifsmountpermissionssamba

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 !!!

Best Answer

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.

Related Question