2

My problem is non-root users can't write to the share when it's mounted. But they can when it's not mounted. The group changes from users to root when I mount the share. And I can't figure out how force the group to remain as 'users' when the share mounts.

The idea is create a Linux and Samba user account, add the account to the group users. Anyone in the group users can read and write to the share.

I've been googling this all day and I've tried modifying, fstab, and smb.conffiles. I've read about Samba share permissions, and Linux file system permissions. I've used the id username command to ensure the user account is in the users group, etc. Would someone throw me a bone and give me a hint on what I should be looking at to solve this problem? I really don't understand why the group changes when the share is mounted.

NOTE: I'm using this as a guide. http://www.howtoforge.com/ubuntu-12.10-samba-standalone-server-with-tdbsam-backend

Here are the permissions when it's mounted:

root@xxxxx:/etc/samba# ls -al /home/shares/export
total 1
drwxr-xr-x 1 root root     0 Jun 17  2014 .
drwxr-xr-x 3 root users 4096 Jun  9 12:24 ..
-rwxr-xr-x 1 root root     0 Jun 17 16:15 test1.txt
root@xxxxx:/etc/samba#

Here they are when it's not mounted.

root@xxxxx:/etc/samba# ls -al /home/shares/export
total 3
drwxrwxrwx 2 root users 4096 Jun 17 16:17 .
drwxr-xr-x 3 root users 4096 Jun  9 12:24 ..
-rwxrwxrwx 1 root users    0 Jun  9 16:34 test5555.txt

Snip from fstab.

//xxxserv/xxxxx_export /home/shares/export cifs nocase,username=xxxxx_export,password=xxxxxxx,iocharset=utf8,sec=ntlm 0 0

Snip from smb.conf

[export]
 comment = export
 path = /home/shares/export
 valid users = @users
 force group = users
 create mask = 0660
 directory mask = 0771
 writable = yes

1 Answer 1

1

When it fails for everyone but root (mounted) it looks like:

drwxr-xr-x 1 root root     0 Jun 17  2014 .

But works when it is unmounted and looks like:

drwxrwxrwx 2 root users 4096 Jun 17 16:17 .

You have a simple permissions problem. Clearly the first one only root has the write permission. On the second, it has full permissions.

When you mount a device, it uses the permissions as set on that device. Mount the device, then change the permissions.

3
  • root@xxxxx:/# chown root:users /home/shares/export chown: changing ownership of `/home/shares/export': Permission denied
    – Jim
    Commented Jun 18, 2014 at 15:04
  • When I try to change ownership with the device mounted I get a permission denied msg.
    – Jim
    Commented Jun 18, 2014 at 15:18
  • @Jim This looks like a mount option/filesystem error since you got permission denied as root. Looking at your fstab snip I'm not sure what though, you can try adding options like permissions and/or rw to the fstab settings for the mount, reboot and see what you get. Sorry for being a whole 2 years late.
    – Cestarian
    Commented Apr 12, 2016 at 9:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .