1

Let's assume there are two ftp accounts ; user1 , user2 and let's assume that public_html folder has two folders : folder1,folder2

user1 is the admin of the host , he has all access overall

I want to make user2 access though ftp only the folder2 and can read-write

What I want is that user2 has full access to the wordpress folder , so he can style it edit it or even delete it , but he can't have any access on other folders INSIDE public_html folder.

how can I do that ?.

2 Answers 2

0

(Note: If this is your own custom server without CPanel this explanation is not valid.)

The only solution I am aware of is provided by the CPanel ftp account setup used by the web hosting companies. All web hosting companies that I am aware of use Cpanel for the customer to set up their web sites.

While setting up the FTP account in Cpanel you are required to set the BASE (starting folder) for the user. The ftp user will only have access to the base directory and all its child folders (folders off of it).

For example if a directory structure is...

      .-dir1--.
dir0--|       |-dir2--dir3--dir4
      |       L-dir5
      .-dir6--.
              L-dir7

If userA has a base set to "Dir1" they will have access to dir1 thru dir5, but not dir0, dir6 or dir7. If userB has their base set to "dir2", they will only be able to access dir2, dir3, and dir4.

Also, I have never seen a way to allow access to just a parent directory but not the child. In my experience they get access to the entire branch of directories.

I am unaware of any other means of ftp directory control - and this is how I do it on all my web sites. I do not know if the .htaccess can in some way be used for ftp access. I also do not know if setting the group permission on a Unix file system could be used to control ftp access.

If you have Cpanel access and can make the one folder that needs access at the end of a branch your problem is solved :)

3
  • Thank you very much for the reply . I want to make user2 have control over dir 1 for example , but he can't manage dir0 and how to do it through filezilla. Commented Jan 1, 2018 at 16:03
  • Wonderful!!! The one thing I forgot to mention about Cpanel is you must get the base directory assigned correctly during the account setup. You wont be able to edit it later. Your only recourse is to delete it and remake the account with the corrections you want.
    – jwzumwalt
    Commented Jan 2, 2018 at 7:20
  • Thank you very much , I noticed it , I mean after it was late lol. Thanks a lot Commented Jan 2, 2018 at 21:14
0

This can be easily done if you control the FTP server, by defining in the FileZilla FTP server the account for user2.

As FileZilla uses its own virtual directory structure, the directory you select as the user's home automatically becomes their root. They are then starting inside their directory, without any chance to navigate further up the tree. The name of their directory isn't shown to them, and it becomes /.

The solution then is to define the home directory of user2 as folder2.

This solution will similarly work with almost all FTP servers that I know of, in case you are using FileZilla only as an FTP client.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .