Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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:

Setting up VSFTPD permissions with Apache server

which outlined the steps:

  1. set up vsftpd for umask 0027 (/etc/vsftpd.conf) [local_umask=0027]
  2. create www group (groupadd www)
  3. add user to group (usermod -a -G www apache and same command with www ftpuser)
  4. Set apache to run as www group (httpd.conf)
  5. chgrp www /var/www
  6. 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.

EDIT:

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.

share|improve this question

1 Answer 1

This is a lot more likely to be a "Protocol" or "Firewall" error then a password error. You may want to try changing between active and passive mode, and also see what happens if you attempt to FTP from the box the FTP server is running on on "Localhost" to rule out errors in the firewall.

Also, although I don't use VSFTP, you will almost certainly it has a log file. If you find the log file it should give you more information about the error (at least if its a password error)

share|improve this answer
    
I can verify that I'm able to ftp in, so connecting to the server and password issues can be ruled out: Password: 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files. ftp> pwd Remote directory: / ftp> It seems to be related to the ownership/permissions and using a group structure, but not sure what exactly. –  Brian Mannopo Aug 16 '13 at 5:32
    
Also, this is what the error log shows when I try to create a file: Thu Aug 15 19:37:17 2013 1 94.251.103.180 0 /untitled_file b _ i r ftpuser ftp 0 * i –  Brian Mannopo Aug 16 '13 at 5:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.