I need files created by apache2 to have umask 002, i.e. group rw, by default. I’ve tried putting umask 002 in /etc/apache2/envvars and although this script does get executed as part of apache start up (apache2ctl graceful) the umask has no effect. Presumably somewhere further in the start up process (e.g. when the user is downgraded from root to www-data) there’s somewhere better to put this. I’ve read posts about fedora and one suggesting putting [...]Continue Reading »
I have not been able to set a umask for www-data (apache’s user). I tried to put umask 002, like in many other examples I found, in /etc/init.d/apache2 script, or in /etc/apache2/envvars…. Then I restart my apache server. As an example, after restarting, if I do: sudo su – www-data touch file The file gets always the default rw-r–r– permissions (umask 022), while I want rw-rw-r– (umask 002). Changing this has been up to now [...]Continue Reading »
I have modified /etc/login.defs and set the umask to 002 but it fails to be changed when I exit or logout and log back in. My bashrc file does NOT contain any umask settings. from /etc/login.defs # # Umask which is used by useradd and newusers for creating # new home directories. # UMASK 002 Any thoughts on why it’s not changing? Despite using Samba, the permissions I’m trying to modify are SSH. As the [...]Continue Reading »
I have a certain directory in which there is a project shared by multiple users. These users use SSH to gain access to this directory and modify/create files. This project should only be writeable to a certain group of users: lets call it “mygroup”. During an SSH session, all files/directories created by the current user should by default be owned by group “mygroup” and have group-writeable permissions. I can solve the permissions problem with umask: [...]Continue Reading »
our apache runs as www-data:psacln if this line is run; <?php file_put_contents(“./file.txt”,”"); then apache creates this file without write permission to the group, -rw-r–r– 1 www-data psacln 9 2010-02-25 16:17 file.txt How can I set our ubuntu/apache so that it gives the group write permission by default upon creating files/folders within web sites? Like DaveG mentions, you can use umask() to change the default permissions of all files created by your process. Your current umask [...]Continue Reading »
I want anyone in group www-data to have write access to /var/www. For example, if ‘a’ and ‘b’ are in group www-data and ‘a’ creates a file in /var/www – then ‘b’ will be able to edit it. The problem is that I create files that PHP and Apache can’t edit – and they create files I can’t edit without sudo. Both PHP and myself are in www-data group. I changed the umask setting /etc/profile [...]Continue Reading »
Most VPS have a team of 1+ user(s) that don’t do anything but configure the system and work on the web site and/or database. I would assume all the team members would be a group like “developers” so they could all work on files in the web root as needed. With this in mind, would umask 007 be a much better setting than the default of 022? After all, there shouldn’t be any “other/world” users [...]Continue Reading »
I have added umask 002 to /etc/profile, but software like git and apache still sets files to 755 instead of 775. Is there a way to force umask 002 for all programs on a machine? I don’t know if this can be done globally but tracking down the startup scripts for the relevant software and setting the umask there should do the trick. Check more discussion of this question. Bookmark on Delicious Digg this post [...]Continue Reading »
We have an Ubuntu 10.04 server. How can I set it so that new files created (or copied) over SFTP or SSH have g+rw and g+rwx permissions (where appropriate)? I’m also using setgid (chmod g+s) so that they inherit the proper group owner. In /etc/ssh/sshd_config, change the following: Subsystem sftp /usr/lib/openssh/sftp-server to: Subsystem sftp /bin/sh -c ‘umask 0002; exec /usr/libexec/openssh/sftp-server’ Soure: http://jeff.robbins.ws/articles/setting-the-umask-for-sftp-transactions Check more discussion of this question. Bookmark on Delicious Digg this post Recommend [...]Continue Reading »
I have proftpd running under user proftpd. I have a new virtual server in ProFTP called “example.com” pointing to /var/www/example.com. I have chowned the /var/www/example.com folder with user “example_com” and group “www-data”. I have set the directory as SGID (2775). This permits the FTP user “example_com” to login and upload files and folders, while permitting the Apache process user “www-data” to run the website and read/write to files. In my proftpd.conf, I have set umask [...]Continue Reading »
- SCP transfer only modified files
- How can I automate clearing and resetting a Linux user’s home directory to a default?
- Cron expression that runs every 5 minutes from 1:30 am – 6:00 am [duplicate]
- Understanding redundant power supplies
- Is there a way for administrators to disable users from installing Firefox extensions?