httpd, vsftpd and the annoying selinux
- by Christian
I have a CentOS 6.3 installed with httpd running and vsftpd but I am unable to balance permission between the user able to upload over ftp and their website working.
What I do:
I create a user with their home directory as `/home/username`
I create a sub folder called `html` for their website
I chown their directory `chown -R username:apache /home/username`
I chmod their directory `chmod -R 750 /home/username`
I chcon their directory `chcon -R -t httpd_sys_rw_content_t /home/username`
and their website loads fine but they are unable to ftp, but if I do the following, they can ftp but their website doesnt load:
chcon -R -t user_home_dir_t /home/username
If I disable selinux, the user can ftp and the website loads. so what is the answer to keep selinux?