Shared directory between two users


Hi all.

I have two users, one with a webserver (user1) and the other with merely ftp access to his home dir (user2).
What I want to accomplish, is user1’s webserver to be able to access a directory with full user rights in user2’s home dir. I can do that by setting other’s user-rights on mentioned directory to rws, but with that, everyone could access the files, which is not what I’d like to have.
I want a place for people who know user2’s password to upload images via user2’s ftp account and read/write/rename/delete those files via user1’s webserver.
I tried using setuid on a directory created by user1 (in a subdir with o+rws rights), but files that are being copied per user2’s ftp still got user2 as their owner instead of user1.

Anyone got some ideas on how I can accomplish this?



Bump :expressionless:


That’s a pretty commonly asked, and discussed question here on the forums, and I don’t think there is an easy answer. You could cobble together a system to do that using unix groups, but that seems overly complicated for what you are trying to to my way of thinking (more info here.) :wink:

When I’ve needed to do what you describe, I’ve always just installed a “filemanager” type script (in perl, not PHP - to avoid upload file size limitations) owned by, and running as, user1, behind .htaccess password protection (or it’s own built in authentication), in user1’s web space and let users use that to diddle with files.

The advantage, to me, is that user1 retains ownership of all the files - I think it just makes its simpler. :wink:



Thanks for the reply!

Well, writing a script is sorta out of question, because I want to upload using an ftp-client… otherwise it’d be a pain to upload files. I don’t mind hard answers though, as long as it’s worth it (i.e. I get what I want).
Unix Groups would be cool, but the wiki-entry about them is kinda empty. How can I get more information about using them on dreamhost?



Everything you are likely to want to know (and more than I care to know :wink: ) is out there on the web under tutorials/instructions for using *nix groups and permissions. There is nothing “special” about their use on Dreamhost, with the exception of allowing for the fact that Dreamhost runs CGI processes under suExec, which ccould have an impact on how you decide to set things up. Google will get you everything you need. Good Luck!