FTP Access


#1

I want to grant users ftp access to a certain folder in my domain. I created a user, but this forces the user to the /home/$user directory. How can I grant a user access to: mydomain.com/downloads & only the downloads directory.

thanks,
-James
Misawa Air Base, Japan


#2

Short answer: You can’t.

Long answer:

You are not granted the ability to control FTP access by DreamHost. Each user gets a home directory, and using FTP protocol they are chroot to their directory. Using SFTP they are not. You can take advantage of standard Unix-style ownership and permissions.

That said, you are mixing apples and oranges. A “directory in a domain” is not the same as a directory on the file system.

The web uses the HTTP protocol. A URL requires what is called a url-path. Most of the time this url-path represents a hierarchy, much like a file system. Normally the logic is that if a web site doesn’t recognize the url-path in a special way (like to redirect you somewhere else) the last resort is to convert the url-path to a file system path and look for something on the file system. This conversion requires what is called the document root directory, but DreamHost calls it your Web Directory.

So what you are actually asking for is to take a url-path and have the web site convert it to a file system path that is different than what it would otherwise be converted to. This is called aliasing, but DreamHost calls it re-mapping a subdirectory and you can do it using the Web Panel by choosing “Remap Sub-dir”.

So given you want the URL to be http://example.com/subdir/ but the files are in /home/second_user/subdir/, you want to map the url-path /subdir/ to the file system path /home/second_user/subdir/

:cool: openvein.org -//- One-time [color=#6600CC]$50.00 discount[/color] on [color=#0000CC]DreamHost[/color] plans: Use ATROPOS7

PS. It occured to me in your question you did not mention accessing the files over the web. Hopefully I did not tell you more than you needed to know.


#3

As many times as I’ve seen that question, or one similar to it, asked on these forums, I think your last post is the best answer offered (and far better an explanation than I’ve ever managed to give). Nice!

–rlparker


#4

Thanks for the quick reply,

By “re-mapping” the subdir, I would be taking that folder offline, correct? Because, after remapping, /home/$user/domain.com/downloads would no longer be online. It would be /home/$diffuser/downloads. I want the Download directory available to the public as well.

Here’s another question: Can I put a symlink to the downloads directory in the new users home directory, and give them write permissions?

-James

James Strickland
Misawa Air Base, Japan


#5

Permissions don’t apply to the symlink itself.

However the new user can be a member of the same group and get group write permissions while the public has only read permissions.

See Traditional Unix permissions

:cool: openvein.org -//- One-time [color=#6600CC]$50.00 discount[/color] on [color=#0000CC]DreamHost[/color] plans: Use ATROPOS7