Make ftp user access one folder?

wordpress

#1

hi
i am a complete newbie to hosting. the dreamhost panel confuses me to begin with. my previous experience has only been to use ftp on other accounts as a user.
i am struggling with a few things but this one really has me stumped.
i want to make a folder e.g. www.mysite.com/folder2 (which i’ve done)
then make a ftp user (which i’ve done) and have him upload files to that folder.
how do i get that user to access that folder without accessing anything else?
i have read these forums and i tried reading the wiki (which is really slim on detailed info for complete newbies i must say) and i’m just getting more and more confused.

currently i can get the ftp user to upload to a user ftp account but its just floating in nothing and i can’t seem to see that account on my domain etc to transfer the info across or anything…i have no idea what i’m doing so please newbie speak to me

my only other choice at the moment is get the user to upload files, then i have to download them to my pc and then upload them again to that folder, which for a lot of data there must be easier way.

i’d really appreciate some detailed advice, thanks


#2

It can be a lilttle bit confusing, but the information is in the wiki; it’s just scatterred over a few places and can be hard to pull together in one place.

I think it will help you understand the issues better if you start with the idea that (absent some major and highly technical workarounds - not recommended for most “new users”), every directory, and file on the DH Debian Linux system has one and only one owner. The reason you are running into troubles is that your user does not own the directoy/files of the “ftp” user.

You have already figured out how to do that, as you indicated - the problem (which I think you discovered, is that now “you” can’t "conveniently’ get at those files without logging on as “his FTP user”.

The files are not “just floating in nothing”, they are in the directory that *his “ftp user” owns, and you are correct that “You” (your user) will not be able to see “his” (ftp user) files from within “your” account.

THere is a better way to deal with this. I think the best way to do what you want is to set up an “uploads” directory (kinda like you have done) but keep that directory under your user. You can then use a script that allows another (or several) users to upload files into that directory, but “you” will own them, and can copy/rename/etc them to your heart’s content, becuase the “script” that uploaded the files runs as “you” (thanks to suexec, if you want to “read up”) and you “own” that directory.

Several of the “one-click” installs have “file upload” capabililty (Wordpress, ActiveCollab, PhPBB), but those may be over-kill for what you need.

Some users install a simple “upload a file” script to allow users to do this.

Other users trying to do what you describe, use a “filemanager” type of script that they install in the sub-directory desired to allow this functionality. Many of these are available at “hotscripts.com”, and they are generall easy to set-up if you read the documentation carefully. The main thing you will need to decide before selecting such a script, is whether you want multiple users to share the same user/password to ge to that “upload/filemanager” function, or whether you need some more sophisticated method to allow seperate users/password, and closer controls of the uploaded files.

–rlparker


#3

a script sounds okey, i’ll look into that when i have some time, thank you!

now for a silly question…what is the point of making a user and having them upload files to their own folder? if only they can use it? i’m looking at this as someone trying to set up a website where i can just say okey user 1 and user 2 i need you to upload to folder 2, and then i don’t have to do anything else…its ready on my site. i guess i just can’t do that with the current DH set up (well maybe this script thing)…so i just don’t see a point in having user ftp if i can’t access it. confused

2nd - i have tentatively looked at subdomain today…would that work? make a folder as a subdomain and put the ownership into the other users name and get them to ftp to the subdomain folder - would i be able to access that on my site? or would it have the non-viewing problems as i already have?

thanks so much for replies.


#4

Well, it’s not really a “silly” question, but you have answered it for yourself: so they can use it. That is a legitimate use for many, even though it does not appear to be what you want to do. It is not also not really true that only they can “use” it, which has to do with how they set the permisiions on the directories and files. That, however, gets into the “pretty technical stuff” I talked about before (you might want to read through Unix Groups and Unix File Permissions (on Dreamhost Wiki), particularly the “Other Resources” section of File Premission (The FIle Permissions “cookbook”))to get a better understanding of what is involved. I suspect you won’t want to jump right end to setting this up for your site :wink: , but it might give you a better understanding of the logic behind how Unix/Linux filesystems are set up.

As you have started to realize, that just won’t work with the approach you are taking. Even if you tackle, and master, the group permissions management, absent some scripting, the files they upload will still need to be “linked” from, or listable from, a “web accessible” space (either web pages -http, or ftp files -ftp site), which has to be reachable from an IP address or a Domain name with a DNS record. Simply setting up a user with ftp space and ftp rights does not accomplish this; it gives them space on your server to put/retrieve files, and that is all. What you are describing however, or a close variation of it, is what Content Management Systems (CMS) and other “scripts” available on the web are all about.

At least you can’t do it the way you invision, as that is not how unix/linux/web serving works. You should also recognize that “access” as you are using it is ambiguous - do you mean “access it as a shell user on the DH system”, or “access it from the web”, etc. Using a script, as discussed earllier in this thread, is the way to do what you describe, and deals with all the “access” ambiguities. You could run everything from a “user” that you set up for this process, giving yourself, and the other contributors equal access - you all use the same ftp space, and username and password, and the pages are all served as “that user” - you would not want to grant that user any more privilges than necessary, and it is not a good security model. You could than reserve your own user for “system” and account use only. I do not recommend doing this.

If you look through the references I have provided, you will see that many of the same issues will apply, as “you” will not own those files. The big difference is that the sub-domain folders are web accessible, so I suppose you could consider that a “step closer” to what you want to acheive - you could then “link” to pages/files in those directories from your pages (or include them via a frame/iframe -arguuugh!).

It’s a little difficult to give good advice on how to do what you want with only a vague description, such as “access that on my site”, as I don’t know what you have in mind in the way of “access” and I don’t know what “that” is - and it does make a difference in determining the “best” way to accomplish it. First blush, in reviewing all of this, is that you might want to look at one of the Content Management Systems (CMS) out there; DH makes Joomla! (excellent!) available via a “one-click” install. WordPress, while designed as a “blog” system, is also being widely used as a “simple” CMS, and allow for other users to not only upload files, but actually prepare content. It is also available via a “one-click” install. With such a system, or a “filemanager” type script, what you want to do is (relatively) easily obtainable.

Carefully structuring unix users, ftp folders, permissions, and other “maintenance” scripts, you can also “make their uploaded files accessible” (from the shell - not necessarily the web) to yourself, but it is not trivial and if you think you are confused at this point, I strongly advise against attempting that process. You would learn a lot, but you’ll be a while getting any pages “up” on the web! A hammer is the right tool to use only if you are staring at a nail. I think your investigation into all this indicates you should rethink your approach.

You really are in an rather enviable position in all this compared to many of us; when I first started doing this stuff, CMS tools were completely outside the reach of all but the wealthiest corporations - hence we had to develop a whole plethora of scripts and such to cobble together the functionality you can now enjoy with a “one-click” install. I say that only so that you are not discouraged about the ftp limitations you are encountering; you have far better tools, that are far more secure, and much better suited for your purpose, available for doing what you want.

Whew! I hope I have not just made it worse - Good Luck :wink:
–rlparker


#5

lol i thank you on writing out such a great reply, it looks like i have a lot of reading to do!

i am currently building a community site which will have the standard web access/browsing at the ‘front’ for reading etc…extended behind this will be pages that are just parent folders with files in them. they’ll be linked via hotlinks from one of the web browsing pages. i’m going to build a catalogue of live recordings and will be getting files from other people in the community. most ‘access’ will be web browsing and downloading only, but i had hoped for the larger files i could get the donaters to upload directly to the correct folder.

i will look into the reading homework you have set :P, unfortunately i just started back at work this week so picked a bad time to figure stuff out.

a subdomain is not really a good solution and the only other thing i could see was the remap but had trouble finding detailed (any) info on wiki on how that worked. mmm i can’t really explain any better what i’m trying to do as its all so new to me still, i’m used to the creative side not running the behind the scenes stuff. currently it looks daunting.

i appreciate your reply thank you!


#6

I’m happy to help you to the degree that I can; I just hope that my tome hasn’t totally put you off on the process!

That said, your last post places the matter in an entirely different (and encouraging) light. I’m taking this as a lesson to me that I should have asked you for more information at the outset, rather than just trying to answer your somewhat imprecise questions. We would both be well-served by a read/re-read of Eric Raymond’s “classic” “How To Ask Questions The Smart Way” (This is not directed solely at you, as it also discusses how to provide “good answers”, which I am overdue reviewing!).

This is a “classic” description of the facility provided by a CMS/Portal system, and the Joomla! system I described is a “perfect fit”. This is far and away the “best” way for for someone other than a highly experienced web application developer to approach what you want to do. Other CMS systems such as Xoops, Postnuke, etc. do much the same thing, but given the current state of Joomla!, its availability as a “one-click” install at DH, and its very active and friendly user community, I strongly suggest you look seriously at this approach. Joomla! is unreservedly recommended for what you are describing, and makes all the preceeding discussion moot; once we know what we are trying to do, we can find the right tool as opposed to trying to worry through how to accomplish the same thing with the “wrong” tool. Along this line of thought, I respectfully suggest that you “rethink” the whole “just parent folders with files in them” and subsequent linking from pages, as this could easily becpome a management nightmare as the sight grows and the contents change. Joomla!, and the other CMS programs I mentioned have a much better way of dealling with this (see below) :wink: .

This could be an example of trying to “force” the “wrong tool” to do the desired job. Joomla!, and the other mentioned CMS systems, have a much more seamless way of allowing users to upload files for subsequent llinking from pages and while it does (at a low level) use directories/folders, it does this via an integrated “repository”, “document manager”, or “filemanager”. This is much easier for your contributors, your users, and you to handle.

Actually, while the previously offerred reading list is still recommended, I wouldn’t tackle those resources now; better to spend your time checking out the Joomla! website. That exercise is likely to leave you more “excited” about having that power available to you at DH via a “one-click” install than “discouraged” about what you need to learn in order to accomplish your goals!

–rlparker