0

as part of some services we are offering to some companies, we have gradually became the hosting providers for them using amazon services. so we host 2 web sites on amazon. the root documents for the website are : /var/www/vhosts/{comp1.com, comp2.com} .

so company 1 wanted to have access to their files so I created a virtual user on vsftpd using this tutorial from www.sigerr.org (which is by the way the clearest and simplest I have seen so far). So i got it working no problem I can connect etc with chroot.

 -comp1.com  // same for comp2.com with chmod set to 555 and chown by root:root
    +htdocs
    +logs

Now the client from company 1 says he doesn't want his Not so IT personel to tamper with files so they only want access to htdocs/Images or htdocs/somefolder/Images (can't remember).

what options do I have? I thought of having a hybrid setup with both virtual and local users where local user's home will be /var/www/vhosts/comp1.com/htdocs/Images but am still unsure of how to go about it.

Can anyone suggest any solution?

Thank you

black sensei
  • 609
  • 3
  • 10
  • 25

2 Answers2

1

I recommend you to switch to more flexible FTP server like Pure-ftpd, where you can configure virtual users with the chroot dir access you want and set up uid and gid virtually.

howto with mysql for Ubuntu

GioMac
  • 4,544
  • 4
  • 27
  • 41
0

I tried to follow the same logic to i created a new virtual user images.comp1.com and created its folder in the vhosts folder:

# mkdir /var/www/vhosts/images.comp1.com
# mkdir /var/www/vhosts/images.comp1.com/images

I later added the privileges and owner as per the tutorial.

#chwown root:root  /var/www/vhosts/images.comp1.com
#chmod 555  /var/www/vhosts/images.comp1.com
#chown -R vsftpd:nogroup  /var/www/vhosts/images.comp1.com/images

after failed trials of doing symbolic links, with little search I realized found out that mount --bind is my best friend in this case. so I did the following

# mount --bind /var/www/vhosts/comp1.com/htdocs/images   /var/www/vhosts/images.comp1.com/images

And so far so good.

THanks for everything

black sensei
  • 609
  • 3
  • 10
  • 25