1

My company has a web designer that's going to upload files to /var/www/html and edit them. I created an account and will give them ssh access.

I added them to the apache group, but they can't access /var/www/html. Currently this is the set up of /var/www/html:

drwxr--r--  5 apache    apache 4096 11月  4 17:56 html

What would give them access to this directory but keep Apache limited? I can change it with chmod 664 apache:apache -R but what other suggestions do you have?

2
  • /var/www/html is a directory so needs to be both read (r) and executable (x) by anyone who needs access to it. so 775 or 770 would be the right perms to allow owner and group rwx.
    – cas
    Nov 4, 2015 at 10:12
  • sorry my ignorance @cas : ) why a directory must be executable in order to be allowed to be accessed?
    – lese
    Nov 4, 2015 at 10:20

1 Answer 1

3

The usual way of addressing this is to put the ftp/sftp users in a chroot, so that they can see only the directory tree which included. The feature is described in several places.

To start:

2
  • Cool, thanks. That's just what I was looking for.
    – Tensigh
    Nov 5, 2015 at 2:16
  • Okay, I've created a chroot for them. But I can't get them to access the /var/www/html folder. I did mount --bind /var/tmp/chroot/var/www/html /var/www/html but now /var/www/html appears as empty.
    – Tensigh
    Nov 16, 2015 at 6:10

You must log in to answer this question.

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