Files permissions

maelamrani

Member
Credits
437
Hello,
how to give all new file specific permissions in a folder.
For exp i have a folder /myfiles and all new files created in this folder will get 775.
Kind regards,
 


f33dm3bits

Gold Member
Gold Supporter
Credits
18,274
You can configure that for the user by setting a umask in the user's ~/.bash_profile or ~/.bashrc if the default umask isn't giving the the wanted permissions for created files and directories.
 

f33dm3bits

Gold Member
Gold Supporter
Credits
18,274
But this manipulation will change permissions for all files created, i should you default acl to inherite permissions
I was just giving you the easier option, is there a reason you only want it for one folder? If you want it for a specific folder you are going to use ACL's using the mask option and why ask a question to which you already know the answer to?
 

maelamrani

Member
Credits
437
i didnt know the answer, i found it in between my post and your answer, but i still have an issue the defautl ACL is applied on the folders and not the files.
I did : setfacl -dm o::5 folder/

drwx---r-x+ 2 root root 4096 Apr 20 13:19 dir => OK
-rw----r-- 1 root root 0 Apr 20 13:19 file => NOK

Should i use the umask acl ?

Kind regards,
 

f33dm3bits

Gold Member
Gold Supporter
Credits
18,274
Try using a default ACL on the directory instead then, take this as an example.
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Members online


Top