Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a folder on a server where a client of mine has a bunch of folders that they upload images and what not for a site, I do a symbolic link to those folders to the root of the website. This way I can give them ftp access to upload whatever they need without having access to the root level of the website.

I have another folder that I can't setup as a symbolic link to their folder, which has images they need to upload to. I know that if I create a symbolic link the other way around where the sym link is in their folder, they can't access it through FTP.

There has to be a way without creating two separate FTP accounts and give a user the ability to upload to a different directory that is outside of their home directory. I see that it is ftp specific and that there are some settings that can be changed but I haven't seen any clear cut answers for the best way to handle this.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

You can use the bind option of mount to remount the other folder so the FTP server sees the files as being within the root of the website.

I posted an answer to the same question on UbuntuForums.org.

...You could mount /home/shared/files/ under /home/website/files/ like this.

  1. Create a mount point ( a directory ) in /home/website

    mkdir /home/website/files/

  2. Mount the other directory under this mount point

    mount --bind /home/shared/files /home/website/files/

It will now appear that those files are actually under /home/website/ so will be available even if you restrict the user to this website root directory....

share|improve this answer
    
thanks, I just saw this on another site as well, when I try it I get this "mount: can't find /path/here in /etc/fstab or /etc/mtab" UPDATE, I see that you kind of explain this in that forum thread. –  dan.codes May 4 '10 at 20:47
    
If you haven't already set it up in /etc/fstab, then you need to specify both the existing directory and the mount point in your mount command. Once /etc/fstab is configured you can just mount it by either the mount point directory name or the existing directory name. –  Richard Holloway May 4 '10 at 21:14
    
hi, how do I see my current mounts ? –  Stewie May 6 '11 at 19:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.