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.

The problem is, they're all creating files for the website and I always have to change the group to www-data so they have permission to it. I can run a cron job, but that seems like a ghetto fix. The users are creating a file locally and just transferring it via SFTP through programs such as Transmit. I am sure I am not the only one having this problem, so I wanted to know how others handled it.

This is the setup I used: http://library.linode.com/security/sftp-jails

share|improve this question
    

1 Answer 1

up vote 4 down vote accepted

Set the group of the directory to the group you want and then set the sgid permission bit. That should do the trick.

$ chgrp ftpusers /data/ftp
$ chmod g+s $_
share|improve this answer
    
What is $_? Also, I thought this was a pretty good explanation of sgid: cyberciti.biz/faq/unix-bsd-linux-setuid-file –  Doug Dec 2 '11 at 8:03
1  
Oh wow! Interesting, it is the first argument of the last command. That is really new to me! –  Doug Dec 2 '11 at 8:06
    
The $_ is also new to me, but this is the LAST argument of the previous command –  f4m8 Dec 2 '11 at 8:47
    
Sorry, probably seems cryptic for people unfamiliar to the syntax. Should have used the folder name instead. But I suppose I underhandedly introduced something to some people ;-) –  Belmin Fernandez Dec 2 '11 at 9:56

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.