By simPod
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
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
In some cases you might also have to -R
setfacl -R -d -m g::rwx /<directory>
setfacl -R -d -m o::rwx /<directory>
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>
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.