Permission denied for user accessing mount

file-sharingmountpermissionssambausers

Using root I can mount another Linux share no problem.

root@crunchbang:/mnt# mkdir javalib
root@crunchbang:/mnt# mount -t cifs //10.1.3.7/javalib ./javalib -o username=guest

Root can read/write to the share dirs no problem.

root@crunchbang:/mnt# ll
drwxrwx---  9 500 users 0 Apr 13 17:59 javalib

root@crunchbang:/mnt# cd javalib
root@crunchbang:/mnt/javalib#

When trying to access the dir under another user, even when the user is part of the 'users' group it gets permission denied.

shawn@crunchbang:/mnt# cd javalib
bash: cd: javalib: Permission denied

Best Answer

As mentioned in one of the comments, try mounting the share using these options:

-o uid=500,gid=users,nounix

or

-o uid=500,gid=users,rw

or this to forgo confusion with regards to CIFS POSIX extensions, as explained in another answer on here.

-o username=guest,defaults,noperm

Depending on your system, the introduction of systemd and udev in Linux has changed how filesystems get mounted once again. However, I'm not sure that/how CIFS/Samba shares are affected by this.

Related Question