I mount a drive with this command in fstab

//analyticstest/datadrive cifs vers=2.1,credentials=/home/ccruzado/.smbcredentials 0 0

The problem is that I have 2 folder within the mounted unit to which I wish to give different permissions, for default the permissions are:

drwxr-xr-x 2 root root 0 Aug 26 21:59 tomcat7
drwxr-xr-x 2 root root 0 Aug 27 14:48 postgres

I want the following:

drwxr-xr-x 2 tomcat7 tomcat7 0 Aug 26 21:59 tomcat7
drwxr-xr-x 2 postgres postgres 0 Aug 27 14:48 postgres

It's possible? I wanted to change permissions with chmod but is doesn't work, when I add the two gid or uid change permissions for both folders, i did this with the command:

//analyticstest.file.core.windows.net/prueba /datadrive cifs vers=2.1,credentials=/home/ccruzado/.smbcredentials,uid=tomcat7,uid=postgres,gid=tomcat7,gid=postgres 0 0

You need create a group (Or add both users to a X group) & add together users to group. Add permissions to group.

  • Thx @pata_de_jaguar, i do this and I add: "dir_mode=0771,file_mode=0771,nounix", but I want to know if is possible to do what I said in my question – Carlos Cruzado Aug 28 '15 at 16:08

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.