I'm have a web server running CentOS Linux 7.2.1511. I do most of the mundane management tasks through Plesk 12.5.30 Update #29 but I also SSH in and get dirty with the command line when I need to. This server is running several websites. I have several different contractors, each that are working on their own set of websites. E.g.

  • ContractorA works on WebSite1, WebSite2 and Website3.
  • ContractorB works on Website1 and Website4.

All websites are exist in their own directories under /var/www/vhosts. E.g.

  • /var/www/vhosts/website1.com
  • /var/www/vhosts/website2.com

How do I grant each contractor access to their respective sites without granting them access to all websites? I dont want to share credentials between users (i.e. create one FTP account per website and pass those out). I also need this to be scalable. I will be adding more contractors and more websites and I will need to be able to grant any contractor access to any website.

As far as I am aware I can only set one home directory per user. I tried creating symbolic links in home directories but the FTP clients weren't showing or following the symbolic links. Because the scalability issue, I dont think I can solve this simply with file permissions (but maybe I am wrong). I saw some suggestions to mount each folder in the users home directory but that is getting a little beyond my capabilities to comfortably perform and I dont want to screw up my HDD.


How about "bind mount" ?

# mount -o bind /var/www/vhosts/website1.com/ /home/ContractorA/website1.com/
# mount -o bind /var/www/vhosts/website2.com/ /home/ContractorA/website2.com/
# mount -o bind /var/www/vhosts/website3.com/ /home/ContractorA/website3.com/

# mount -o bind /var/www/vhosts/website1.com/ /home/ContractorB/website1.com/
# mount -o bind /var/www/vhosts/website4.com/ /home/ContractorB/website4.com/

Unmount is the same as usual.

# umount /home/ContractorA/website1.com/
  • That worked beautifully. I know I didnt ask this before, but for completeness, can you add how to unmount them too? – Jeff May 5 '16 at 17:45

Configure the approriate SELinux booleans

List the related booleans

# semanage boolean -l | egrep 'ftp|http' | sort

Turn on booleans that may be applicable temporarily i.e.

# setsebool httpd_can_connect_ftp on

To turn a boolean on permanently use -P flag i.e.

# setsebool -P ftp_home_dir on
  • I dont see anywhere in these commands that specifies anything about individual user accounts or website folders. How will I specify access per user per website? – Jeff May 5 '16 at 17:47

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.