How can I set default chmod for new files or folders to 777? I don’t want to run chmod -R 777 everytime the file is created. Any ideas? Thanks
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $100 of credit to try our products over 60 days!
Hi,
In order to set a folder to grant default permissions to subfolders, you will need to do the following:
chmod g+s <directory>
This sets the group ID for the directory. Then, you can set your group to
rwx
by default with this command:setfacl -d -m g::rwx /<directory>
Finally, to set all other users with the same permissions of
rwx
(which is a less secure setting):setfacl -d -m o::rwx /<directory>
After running those commands, check permissions with
ls -al /<directory>
In some cases you might also have to -R