My original problem is that I want to create a shared hosting like environment on my VPS. Basically, what I want is to have multiple directories within my apache web-root, which will all be designated to a particular website, which should be wrx accessible by multiple users. Along with that, I'm trying to have files created and changed by ssh/sftp users be accessible to other users I assign that particular website to. So, a use-case, assuming www-data is Apache user and www-data is Apache group:

I want to have, say, 2 websites, www.foo.com and www.bar.com. Path to their publicly visible directories are, respectively:

  • /var/www/html/www.foo.com/www
  • /var/www/html/www.bar.com/www

    I also want to have 3 users, Bob, Mark and Layla, that can SSH/SFTP into the VPS, following these rules:

  • Bob can SFTP/SSH into VPS, and his landing directory should be /var/www/html/www.foo.com. Bob should be able to read, execute and write to every single directory and file within landing dir. Apache should too.
  • Mark and Layla can SFTP/SSH into VPS, and landing directory for both of them shoud be /var/www/html/www.bar.com. Apache should too.

I've tried to make this happen, by adding users, changing their home directories, putting them in various groups, but there was always an issue when I tried to log-in as those. /var/log/auth.log wasn't really helpful, except for mentioning chroot. Now, I've read about jailkit, but am still unsure on both how to set it up to have what I want nor would it help. Any help would be much appreciated.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.