Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

Thanks

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
add comment

3 Answers

up vote 2 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
add comment

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
add comment

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
add comment

Your Answer

 
discard

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.