Multiple FTP accounts - chmod issue


#1

Hey folks,

I’ve made a web image gallery for my family. I set up FTP accounts so they can upload images to their own directories with ease. However, I also wrote some resize and rotation scripts. Here’s the problem: I can’t update their files because they’re not chmod’d properly. I don’t want to copy their files over to my username, so I need a better solution. Here are my ideas, none of which seem to work in a dreamhosters environment:

  1. Have a mask so that the uploads are at minimum 775.
  2. Allow my main account to execute commands as the other account (have to edit the sudoers file)
  3. Do something crazy like set up ssh keys between the accounts and fire off an exec() call that ssh’s a chmod command.

Can anyone provide a solution?


#2

Sticky bit should work:
http://wiki.dreamhost.com/Unix_File_Permissions_Cookbook#Recipe:_Maintaining_Group_Ownership
http://wiki.dreamhost.com/Unix_File_Permissions

Since you want to resize and rotate, it sounds like it needs a manual process. If you can write a script that automates it, your users can have a cronjob that wgets the latest version of your script and then runs it.

-Scott


#3

sticky won’t work if they upload @ 0755. I’ve set up a cron job and “fix me” button for now.


#4

I use Transmit for the Mac, and it lets me set my permissions on uploads. I suppose a cronjob that fixes permissions will have to do.

-Scott


#5

Yeah, or a “fix me” button… sigh. These are total noobs, using another piece of software just won’t work.