Setting up Apache with multiple FTP users and vsftpd












1















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















    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












      1








      1








      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
















      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.







      permissions centos apache-http-server ftp vsftpd






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 20 '17 at 10:17









      Community

      1




      1










      asked Aug 16 '13 at 4:02









      Brian MannopoBrian Mannopo

      613




      613






















          1 Answer
          1






          active

          oldest

          votes


















          0














          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








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f632581%2fsetting-up-apache-with-multiple-ftp-users-and-vsftpd%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          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
















          0














          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














          0












          0








          0







          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













          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












          share|improve this answer



          share|improve this answer










          answered Aug 16 '13 at 5:23









          davidgodavidgo

          44.6k75292




          44.6k75292













          • 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



















          • 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

















          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







          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





          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


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f632581%2fsetting-up-apache-with-multiple-ftp-users-and-vsftpd%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

          Mangá

          Eduardo VII do Reino Unido