Granting all users access to mounted CIFS shares
Solution 1
You probably want to add explicit permissions to the mounted file system in the fstab
entry:
<your other options>,file_mode=0770,dir_mode=0770
This will be on the safe side by allowing all group members to read, write and execute all files and prohibiting access to any other user of the system. If you still want read access for the others you will have to replace the 0
by an appropriate value. e.g.
<your other options>,file_mode=0775,dir_mode=0775
for read and execute rights.
Solution 2
In my case with Win 10, besides the permissions in gnu/linux side
sudo mount -t cifs -o username=user1,file_mode=0777,dir_mode=0777 //192.168.1.11/shared-d ~/shared-d
I had to add permission to "everyone" for read/write in Windows side: properties -> sharing -> share...
Related videos on Youtube
Comments
-
Andro over 1 year
I'm trying to set up a debian server that will run several network-based services. These services need access to an external network drive to store their data. For security reasons, I have set up each service to run under it's own user. To allow them all to access the network share, I created a new group,
driveaccess
, with gip 1003I then set up the network share by adding the following to /ets/fstab
//192.168.42.2/Data/ /media/Data cifs guest,rw,mand,gid=1003,forcegid,user=duckies%swordfish 0 0
After mounting the drive, the service accounts see the premissions as
-rwxr-xr-x 1 root driveaccess 1544704 Jun 1 2013 AppData1.dat
And the processes can read the data with no problems, but any attempt to write to the drive fails
touch: cannot touch `test.txt': Permission denied
What do I need to add to the fstab to let everything in the driveaccess group write to the share?
I already executed:
usermod -aG driveaccess serviceaccount1
-
Sridhar Sarnobat about 8 yearsIs this supposed to work on Mac too? I get
mount_smbfs: -o file_mode: option not supported