linux umask for sudo and apache

▼魔方 西西 提交于 2019-12-05 01:14:43

问题


I want to make 002 the system-wide umask for all users (in Ubuntu). I managed to do so for all regular users using the instructions provided by @ephemient (From this post, thanks for that!). However I got 2 more problems.

Firstly, when sudoing, the root user seems to follow it's own settings, making files with the permissions 644 (instead of 664).

Secondly, the apache user (www-data) also seems to follow it's own settings (the same used by root?), making files with the permissions 644 (instead of 664). I don't like to put umask 002 in /etc/apache2/envvars, I'd rather change the setting assigning the 002 umask to apache in the first place.

How can I tackle those last 2 issues?


回答1:


I solved my own problems.

For the sudo permissions, I executed sudo visudo and added the line Defaults umask = 0002 to the end.

For the Apache user, I added the line umask 0002 to the end of the /etc/apache2/envvars (I couldn't find any better solution).



来源:https://stackoverflow.com/questions/22813873/linux-umask-for-sudo-and-apache

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!