I'm trying to get my Apache setup with a single user 'ftpuser' both be able to share/access the
/var/www/html directory, which contains various files/sub directories. However, when I log in via FTP under 'ftpuser,' everything is empty and I can't upload anything. Here is what I followed to do this:
which outlined the steps:
- set up vsftpd for umask 0027 (
- create www group (groupadd www)
- add user to group (
usermod -a -G www apacheand same command with www ftpuser)
- Set apache to run as www group (httpd.conf)
chgrp www /var/www
chmod 2775 /var/www
I restarted Apache/vsftpd after all of this. However, when I try to FTP in, the directory is blank and if I try to create a file, it says, "Could not start data transfer." I'm assuming this is a permission denied error.
I also edited the
/etc/passwd file and changed the home directory to
/var/www/html. Could someone shed some light as to what the issue is? Thanks.
In case anyone else has this issue, the problem was that selinux had been disabled, but wasn't actually disabled. It needed to be restarted before it was disabled and was no longer locking down the home directories. If you want to keep selinux enabled, use the below command:
setsebool -P ftp_home_dir on
Hope that helps someone.