Possible to create default permissions?

Status
Not open for further replies.

FlexibleToast

Dabbler
Joined
Aug 10, 2014
Messages
32
I have a dataset that is being nfs shared to a server that is hosting Nextcloud. Everything works, but anytime a file is created the permissions are 644:
Code:
root@freenas:/mnt/tank0/home/joseph/files # ls -l
total 75917
...
drwxrwx---  2 www-data  joseph		 3 Jan  1 18:51 Test
...
root@freenas:/mnt/tank0/home/joseph/files # cd Test/
root@freenas:/mnt/tank0/home/joseph/files/Test # ls -l
total 1
-rw-r--r--  1 www-data  joseph  8 Jan  1 18:51 Test file.txt <-- File created in Nextcloud gui

What I want is the user and group to have read/write and others to have no access, so 660. Can I change the umask for just one directory and its sub directories? Is there a way to do with acl's? I'm not sure how to proceed.
 

FlexibleToast

Dabbler
Joined
Aug 10, 2014
Messages
32
I finally pieced enough information together to solve my own question. It is the 'fd' in this command that says to inherit the "ACE" to files and directories.
Code:
setfacl -m everyone@::fd:allow Test
setfacl -m group@:rwxpdDaARWcCos:fd:allow Test

What a pain of a command.

Edit: That actually didn't do the trick. When I was testing over SSH everything worked perfect. It seems none of the changes stuck though. Anyway to properly do this?
 
Last edited:

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Set the umask value in your nfs mount options or in next cloud. This has nothing to do with freenas.
 

FlexibleToast

Dabbler
Joined
Aug 10, 2014
Messages
32
That could do the trick. Setting both the umask in NFS and the SMB shares. I'll give it a shot tomorrow. Thanks for the reply. I disagree about it not being a FreeNAS issue, kind of. Yeah, you can do it this way, but it still appears that it could have been solved with the ACL if FreeNAS allowed for it. Before I did a clean install and migrated my data, that's how I had it set up. I had set it up with ACLs over ssh. Now it seems like that same technique isn't a permanent change for some reason. Please correct me if I'm wrong.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
That could do the trick. Setting both the umask in NFS and the SMB shares. I'll give it a shot tomorrow. Thanks for the reply. I disagree about it not being a FreeNAS issue, kind of. Yeah, you can do it this way, but it still appears that it could have been solved with the ACL if FreeNAS allowed for it. Before I did a clean install and migrated my data, that's how I had it set up. I had set it up with ACLs over ssh. Now it seems like that same technique isn't a permanent change for some reason. Please correct me if I'm wrong.
I have no clue what you did before but you can use acls of you want. Just change the dateset to windows. You can then edit the acls via setfacl or a Windows machine.
 
Status
Not open for further replies.
Top