SMB Share - set permissions in Linux

Status
Not open for further replies.

OBRI

Dabbler
Joined
Apr 15, 2017
Messages
30
Hi all,

first of all, thanks for your help. I build up my first freenas machine an it works. I got all information needed by reading the forum :)

But now I can´t solve the following problem:
I created a samba share and mounted it in my linux machine. So far so good. I´ve read and write acces an can store my files there.
But I can´t change the permissions of files and directorys in linux. It´s a weird thing. As owner of the files, I can´t change the permission.
I want rwx just for the owner of the files. But that is refused, because I don´t have the permission.

What am I doing wrong? Can someone help me there?

the fstab entry is: //192.168.178.33/BackupOliver /mnt/freenas/BackupOliver/ cifs username=xxxxxxxxxxx,passwd=xxxxxxxxxx noauto,rw 0 0

Thanks in advance and have a nice day!
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
That's expected, unfortunately. You need something that can handle Windows ACLs, which apparently does not really exist in GUI form? It's weird.

This bug report is the one to follow:
https://bugs.freenas.org/issues/23398
 

OBRI

Dabbler
Joined
Apr 15, 2017
Messages
30
Hmm is there a way to change this via command line directly in the FreeNAS server? So that all files stored in the share have rwx for the owner and no rights für group and others?

The best would be, if the permissions would be set as they are originally. But if always owner has rwx and all others nothing, it would be ok for me.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Yes, but I think you can't set them recursively, which makes things a pain in the ass. The standard way is to use a Windows client (yes, it's silly, hence the feature request).
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Yes, but I think you can't set them recursively, which makes things a pain in the ass. The standard way is to use a Windows client (yes, it's silly, hence the feature request).

I think the slow development of permissions inheritance in smbcacls is due to a couple of factors (1) lack of developer interest. There is a single developer working on the problem. (2) Scope. smbcacls actually allows you to modify ACLS on all SMB servers. Windows and Samba. This means it needs to be really well vetted.

As far as the lack of GUI goes, the samba project tried to do GUIs once (SWAT). Thankfully, they came to their senses and stuck to what they're good at. :D Once smbcacls gains the ability to recursively set permissions on SMB shares, I imagine it will only be a matter of time before the developers for {dolphin | nautilus | thunar | whatever} work on creating a proper UI integrated into their file managers.

In the meantime, you can do something like find /path/to/dir -exec setfacl -x everyone@:allow {} \;.
Caveat 1: I haven't verified the above command works / doing this from memory. Test on something you don't care about first.
Caveat 2: It is really important to put the correct path in the "find" command. Extra spaces are not your friend. e.g. "/ path/to/dir" vs "/path/to/dir"
 
Last edited:
Status
Not open for further replies.
Top