Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a number of services on an Ubuntu 12.04 server and I'm making each of them run under their own user account instead of running under my account (for improved security as well as seeing which applications are consuming the most resources).

One of my services (we'll call this application-foo) downloads a file and saves it locally to a Downloads folder in my home directory. Another service (we'll call this application-bar) then finds the downloaded file and moves it to another location.

user-foo downloads the file using application-foo

user-bar moves the downloaded file using application-bar

Both user-foo and user-bar are members of the downloads group

The downloaded file is sent to:


That Downloads folder has permissions set to 775 with kris:downloads as the owners. I've set the user and group to be sticky bits.

When user-foo finishes downloading a file and puts it to my Downloads folder, it's setting the permissions as:

user-foo:downloads 755

instead of:

kris:downloads 775

This is a problem because user-bar is part of the downloads group, and since that file now does not have write permission on the group, user-bar is unable to delete the file after moving it.

I've tried creating a .profile file and setting umask=002 for /home/user-foo, but that didn't work. I've also tried setting a global umask value in /etc/profile and /etc/login.defs (which didn't work either).

I even tried using setfacl to make the g::rwx and g:downloads:rwx, but that didn't change anything.

What am I missing?


Just to add, if I log in as this user (sudo su user-foo), enter my /home/kris/Downloads directory, and create a new directory (mkdir test), the created directory has permissions set correct at 775. But for whatever reason, when application-foo creates the directory, it's setting the permissions incorrectly at 755.

share|improve this question
Can you add umask >> /tmp/umasks to user-foo's downloading script temporarily, just to confirm whether the umask 002 command is having an effect? That seems like the first potential failure point to rule out. –  Paul Jun 8 '13 at 3:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.