Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

linux umask for sudo and apache

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?

like image 789
user1834095 Avatar asked Apr 02 '14 13:04

user1834095


1 Answers

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).

like image 139
user1834095 Avatar answered Sep 27 '22 19:09

user1834095