I am trying to create an ftp user that will have access to several folder on public_html but I don't want him to get access to all folders in public_html. Just to the specific ones.

Here is the folder structure from public_html


what I am trying to do is to create ftp user ftpdevteam1 that can access site1-4. ftpdevteam2 can access site5-8

I tried the solution on this post http://www.webhostingtalk.com/showthread.php?t=681872

Specifically this part

ln -s /home/{username}/public_html/index.html /home/{username}/{ftpusername}/index.html

ln -s /home/{username}/public_html/folder1 / /home/{username}/{ftpusername}/folder1

ln -s /home/{username}/public_html/folder2 /home/{username}/{ftpusername}/folder2

but when I access via filezilla I get this...

Status: Retrieving directory listing of "/foldername"...
Command:    CWD /
Response:   250 OK. Current directory is /
Command:    CWD foldername
Response:   550 Can't change directory to foldername: No such file or directory
Error:  Failed to retrieve directory listing

Is there a way to edit permission of ftp user so they can access the folders?

I saw another solution using bind in this post https://www.hostivate.com/blog/cpanel-ftp-user-access-multiple-folders/

but I saw in step 2 it says

2. We must create the above folders but in the FTP user directory

This doesn't seem to be a viable solution because my sites are already created folders. My understanding in this step 2 is that the real folder needs needs to reside inside _ftpdevteam1 folder.

Anyone who has any other way to be able to achieve what I am trying to do?



As i understood you need a bind mount. Try this:

mkdir /home/{username}/{ftpusername}/public_html
sudo mount --bind /home/{username}/public_html /home/{username}/{ftpusername}/public_html
  • Hi. Im ready to try your suggestion but it looks to me in your suggestion that ftpuser will have full access to public_html not just specific folder. I only want to give user access to some folders in public_html not the whole public_html. can you confirm? thanks – Wayne Jan 15 '16 at 14:07
  • mkdir /home/{username}/{ftpusername}/the_folder_you_need sudo mount --bind /home/{username}/public_html/the_folder_you_need /home/{username}/{ftpusername}/the_folder_you_need – user1700494 Jan 15 '16 at 15:13
  • will this duplicate the copies of files or will only create link just like symlink? – Wayne Jan 16 '16 at 20:20
  • just like symlink – user1700494 Jan 17 '16 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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