Browsing articles tagged with "umask - Admins Goodies"
May 1, 2012
tom

How do I set default umask in apache on debian?

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 »
Mar 29, 2012
tom

How to set default group permission in Ubuntu for www-data (apache’s user)?

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 »
Nov 15, 2011
tom

Modifying umask for all users not functioning

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 »
Aug 20, 2011
tom

Specify default group and permissions for new files in a certain directory

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 »
Aug 19, 2011
tom

How can I give default group write permission to a file created by www-data?

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 »
Aug 18, 2011
tom

All users of a group can edit each others files (Linux)

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 »
Aug 18, 2011
tom

Proper umask on linux webservers?

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 »
Aug 17, 2011
tom

Howto force umask 002 for all software?

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 »
Aug 17, 2011
tom

How do I set default permissions for SFTP for an Ubuntu Server?

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 »
Aug 16, 2011
tom

Understanding Permissions with ProFTPD (Especially Group Write)

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 »
Pages:12»