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

link|improve this question

feedback

1 Answer

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 $_
link|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 ;-) – Beaming Mel-Bin Dec 2 '11 at 9:56
feedback

Your Answer

 
or
required, but never shown

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