Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to allow members of the group 'ftpusers' to be able to change permissions on all objects inside a certain directory. I was looking into how to do it but all I have found is how to do it on BSD:

chmod +a "ftpgroup allow writesecurity" /some/dir

I need exactly the same thing but for Debian/GNU.


share|improve this question
What type of filesystem are you using? What is the current permissions? – Zoredache Mar 25 '10 at 18:49
Filesystem is ext3. Current permissions: drwxrwxr-x 9 drasko ftpgroup 4096 2010-03-25 10:20 dirname – Drasko Mar 25 '10 at 19:30
up vote 5 down vote accepted

Only the owner of a file or root is permitted to change permissions in Linux (write access != permission change access)

The only way I can think of is using sudo. I don't know if that would do the trick, and I'd be exceedingly cautious about how you specify the sudo rules so that the users don't have any additional privileges.

Note that if they are connecting using an FTP server, sudo probably won't be the answer.

share|improve this answer

Just give the 'ftpusers' write permissions and ownership on that directory:

chgrp ftpusers <directory>
chmod g+rwx <directory>

And then set the GID bit so all new files inherit group ownership:

chmod g+s <directory>
share|improve this answer
That was my thought exactly but it doesn't work, I get 'Operation not permitted' if I try to change anything – Drasko Mar 25 '10 at 18:46
What are the current permissions? – Vitaliy Mar 25 '10 at 19:04
drwxrwxr-x 9 drasko ftpgroup 4096 2010-03-25 10:20 dirname – Drasko Mar 25 '10 at 19:31

One solution (which I've had to use) is a cron job going through and changing the permissions of a specified directory and files under it. Not pretty but it works.

If you want to extend the ability of users to change this, you might consider allowing the users from the ftpgroup to allow chmod within the specified directory with an appropriate rule using sudo.

Or you can make a shell script which does the appropriate checks and does the function, and make that program allowed to be run via sudo. I do not suggest nor recommend a set-uid shell script.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.