By cloudnine
For the domains/sites running on my Ubuntu 14.04 server, I had added the Linux user accounts to the www-data group. The document root (public_html) of the individual Linux user accounts that correspond to each web site are chowned to user:user.
Now, when directories or files are created through SFTP or shell, they have 775 and 664 values. Is there a way to set the umask server-wide so that all directories have 755 as default and all files have 644 as the default?
Thanks in advance.
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!
To set the system wide default umask for all user you need to make the below configuration in your server.you need to add the below configuration in /etc/profile to have newly created directory having 755 and file having 644 permission.
umask 0022
Noe logoff the session and check the newly setup umask using usmak command.
Note:Note that users may still override umask in their own ~/.profile or ~/.bashrc or similar, but (at least on new Debian and Ubuntu installations) there shouldn’t be any overriding of umask in /etc/profile or /etc/bash.bashrc. (If there are, just remove them.)
Hope it will help you.
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.