I run apache as user www-data on Ubuntu 10_04 LTS. I’ve got /etc/apache2/envvar setup with ‘umask 002′ so that any new files/dirs created by the daemon have group write permissions enabled. At times, I need to create files/dirs from the command line so I do ‘sudo -u www-data’ commands, but I can’t figure out how to get those to enable group write permissions on creation.
In /etc/passwd, Ubuntu’s home directory is listed as ‘/var/www’. So, per the ubuntu documentation (https://help.ubuntu.com/community/EnvironmentVariables), I’ve tried adding “umask 002″ to the following locations:
And the the global environment files:
Even after adding “umask 002″ to all those files and rebooting, running ‘sudo -u www-data touch testfile’ results in “-rw-r–r–” permissions. (I tried that with the www-data shell set to both /bin/sh and /bin/bash.)
Is there any way to setup so that ‘sudo -u www-data’ commands will create items with group write permissions enabled?
Have you tried setting it via
/etc/sudoers itself? As per
umask_override If set, sudo will set the umask as specified by sudoers without modification. This makes it possible to specify a more permissive umask in sudoers than the user's own umask and matches historical behavior. If umask_override is not set, sudo will set the umask to be the union of the user's umask and what is specified in sudoers. This flag is off by default.
Leave a comment
- What is the easiest way to upgrade my existing Perl 5.14 to Perl 5.16 on FreeBSD 9 using the ports system?
- Know if mysql has done its job
- Redirect https .com to https .co.uk without a valid SSL cert on .com without DNS change
- Why is it a bad idea to use customer email as from address
- 100% packets dropped on first RX queue on 3/5 raid6 iSCSI NAS devices using intel igb (resolved)