Shared folder via FTP


#1

I’ve tried searching the forums but couldn’t find anything relevant. I have a few users and I’d like to be able to share a folder so that certain users are able to view it. I’m able to do this through the shell with no problem. Unfortunately this method does not work for FTP. My guess is that “following links” has been dissasbled in FTP.

This is simply so that I can share files and photos with a few close friends, I’m not concerned with quotas, or file protection.

Is this possible?


#2

There are lots of posts discussing various “ins and outs” and “pros and cons” of various ways to do this on these forums (your search kung fu is weak :wink: ).

Rather than repeat all that “in depth” discussion and analysis, my bottom line suggestion:

Install a web-based file-manager type application in an .htaccess protected directory. If you use php, you will end up with a file upload size limitation of 7 mb; I recommend using a perl script - there are many “free” and commercial available at hotscripts.com.

One I like, and use, a lot is ffileman Good Luck!

–rlparker


#3

FTP limits a user to their own directory. But if your FTP software allows you to use SFTP instead, you’ll be able to navigate around more.

I don’t think I’ve seen ffileman before, but I use PHPfileManager. It’s a bit more fancy, but rlparker’s is a nice basic file manager.

-Scott


#4

While ffileman is nice and would do in a pinch I don’t think it’s quite what I’m looking for. I’m really looking for a way via FTP. I could simply give everyone one ftp account but I’d like for them to have their own as well.

It might be true that my search fu isn’t up to par, but I really did search… really.


#5

Scott, I agree that PHPfileNavagator is a great application. I have used it also, and like it a lot! :slight_smile:

–rlparker


#6

As I said, pure FTP won’t work, but an FTP client that supports SFTP will be transparent to the user and can do what you’re looking for.

-Scott


#7

I was just kidding you about the “weak search kung fu!” (didn’t you see my :wink: ?). It is hard to find stuff in here sometimes, especially if you are not used to this software - I keep forgetting to set the search for “and” instead of the default “entire phrase” (which generally returns very little).

The biggest problem you are likely to find is the way *nix permissions work with ftp. To do what you are talking about, while maintaining the ability to manage the files as your own user, and without allowing the other users full access to your stuff, you will need to get involved with groups and permissions at a fairly complicated level.

Here is a short excerpt from the Dreamhost wiki article on users:

[quote] How do I share website access with another FTP user?
If you want to add another user with access to all the same files as an existing user:

Basically, you can’t. In unix systems, files are all owned by exactly one user, and it’s not secure to allow other users full read/write access to them all. If you really want multiple people to have all the same access to the same files via FTP, the best thing to do is create one FTP user for all the stuff you want to share, and just use that same login info among all the people who need to work on the site.

If you want to give full website access to a new FTP user:

Just move the domain to that FTP user (via the “edit” link at Domains > Web (https://panel.dreamhost.com/?tree=domain.web)). If you still want access yourself, just also use that same FTP user. Multiple people can log in at the same time with the same user. (Due to FTP users not being able to go outside their home directory and problems with group writability for CGI scripts, only one FTP/shell user may access the web directory for a website hosted with us.)

If you want to give access to just one sub-directory of your website:

Leave the site as is and just use our Domain > Remap Sub-Dir (https://panel.dreamhost.com/index.cgi?tree=domain.mapsubdir&) area to put that one subdirectory in the new FTP user’s home directory. The only caveat with this is that CGI and PHP-CGI won’t work in that directory (since it’ll have a different user than the rest of the domain).

Basically, one FTP user can have access to multiple domains, but each domain can only be accessed by one FTP user. i.e, each domain is owned by exactly one FTP user. One FTP user can own multiple domains though![/quote]
One way to share a directory is just to create a new ftp user in addition to your “domains’” user and give it it’s own directory - then you all use that login (you’ll have to make other arrangements to use the files as “your” user).

The reason that scripts work so well for sharing files, is that under Dreamhost’s implementation of suEXEC, the script runs as your user, and therefor “you” own all the files it handles, which makes things easier - you control access programmatically rather than via the *mix user system, so the files are always fully accessible by you at all times. There is a lot of information pertinent to this in the Dreamhost Wiki under ftp, users, chmod, permission, groups, etc. Good Luck!

Edit: Plus, Scott has a good suggestion re. sftp - you can traverse the full tree with such a client (as you can with ssh)!

–rlparker


#8

Sorry sdayman I didn’t catch your post before replying.

rlparker, I just took it as a gentle ribbing.