Problen with VSFTPD can't download files










0















This is my firs question and I really did research through internet and here in stackoverflow. But nothing worked out.



I have set up an FTP server in an AWS-EC2 instance following the current guide answered on this question:
Setting up FTP on Amazon Cloud Server



It worked out except that the scenario i need is quite different that for using folder as web folder:
What I want is to have one specific ftp-user to access just one folder in the web server to download some videos that are recorded by users with PHP and JavaScript. The videos are correctly generated and ownership is apache:apache



Video folder is: /var/www/html/XXXXX/uploads and has 775 permisions



I have an .htaccess file to prevent web access to folder and directory listing:



sudo cat .htaccess 
# secure .htaccess file
<Files .htaccess>
Order allow,deny
Deny from all
</Files>
# disable directory browsing
Options All -Indexes
# prevent folder listing
IndexIgnore *


I added the user "video" to the apache group as explained in the guide (usermod -a -G apache video)



This is my VSFTPD conf file:



sudo cat /etc/vsftpd/vsftpd.conf 
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_file=/var/log/xferlog
chroot_local_user=YES
listen=NO
listen_ipv6=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
pasv_enable=YES
pasv_min_port=1024
pasv_max_port=1048
pasv_address=XX.XXX.XXX.XXX
local_root=/var/www/html/XxXxXxXxX/uploads
allow_writeable_chroot=YES
download_enable=YES


My ftp client connects correctly to the server and shows the contents of the folder but is unable to download any. The ftp-client answers "Connection refused". But even i try to find anything on /var/log/xferlog nothing is there. Nothing logged, file is empty.



I even tried to create a file with the user in ssh console by "sudo su video" and "touch test.file" the file is generated but also unable to download.



Researched here, over internet, forums, everywhere... can't find any solution.



Thanks in advance for your help.










share|improve this question


























    0















    This is my firs question and I really did research through internet and here in stackoverflow. But nothing worked out.



    I have set up an FTP server in an AWS-EC2 instance following the current guide answered on this question:
    Setting up FTP on Amazon Cloud Server



    It worked out except that the scenario i need is quite different that for using folder as web folder:
    What I want is to have one specific ftp-user to access just one folder in the web server to download some videos that are recorded by users with PHP and JavaScript. The videos are correctly generated and ownership is apache:apache



    Video folder is: /var/www/html/XXXXX/uploads and has 775 permisions



    I have an .htaccess file to prevent web access to folder and directory listing:



    sudo cat .htaccess 
    # secure .htaccess file
    <Files .htaccess>
    Order allow,deny
    Deny from all
    </Files>
    # disable directory browsing
    Options All -Indexes
    # prevent folder listing
    IndexIgnore *


    I added the user "video" to the apache group as explained in the guide (usermod -a -G apache video)



    This is my VSFTPD conf file:



    sudo cat /etc/vsftpd/vsftpd.conf 
    anonymous_enable=NO
    local_enable=YES
    write_enable=YES
    local_umask=022
    dirmessage_enable=YES
    xferlog_enable=YES
    connect_from_port_20=YES
    xferlog_file=/var/log/xferlog
    chroot_local_user=YES
    listen=NO
    listen_ipv6=YES
    pam_service_name=vsftpd
    userlist_enable=YES
    tcp_wrappers=YES
    pasv_enable=YES
    pasv_min_port=1024
    pasv_max_port=1048
    pasv_address=XX.XXX.XXX.XXX
    local_root=/var/www/html/XxXxXxXxX/uploads
    allow_writeable_chroot=YES
    download_enable=YES


    My ftp client connects correctly to the server and shows the contents of the folder but is unable to download any. The ftp-client answers "Connection refused". But even i try to find anything on /var/log/xferlog nothing is there. Nothing logged, file is empty.



    I even tried to create a file with the user in ssh console by "sudo su video" and "touch test.file" the file is generated but also unable to download.



    Researched here, over internet, forums, everywhere... can't find any solution.



    Thanks in advance for your help.










    share|improve this question
























      0












      0








      0








      This is my firs question and I really did research through internet and here in stackoverflow. But nothing worked out.



      I have set up an FTP server in an AWS-EC2 instance following the current guide answered on this question:
      Setting up FTP on Amazon Cloud Server



      It worked out except that the scenario i need is quite different that for using folder as web folder:
      What I want is to have one specific ftp-user to access just one folder in the web server to download some videos that are recorded by users with PHP and JavaScript. The videos are correctly generated and ownership is apache:apache



      Video folder is: /var/www/html/XXXXX/uploads and has 775 permisions



      I have an .htaccess file to prevent web access to folder and directory listing:



      sudo cat .htaccess 
      # secure .htaccess file
      <Files .htaccess>
      Order allow,deny
      Deny from all
      </Files>
      # disable directory browsing
      Options All -Indexes
      # prevent folder listing
      IndexIgnore *


      I added the user "video" to the apache group as explained in the guide (usermod -a -G apache video)



      This is my VSFTPD conf file:



      sudo cat /etc/vsftpd/vsftpd.conf 
      anonymous_enable=NO
      local_enable=YES
      write_enable=YES
      local_umask=022
      dirmessage_enable=YES
      xferlog_enable=YES
      connect_from_port_20=YES
      xferlog_file=/var/log/xferlog
      chroot_local_user=YES
      listen=NO
      listen_ipv6=YES
      pam_service_name=vsftpd
      userlist_enable=YES
      tcp_wrappers=YES
      pasv_enable=YES
      pasv_min_port=1024
      pasv_max_port=1048
      pasv_address=XX.XXX.XXX.XXX
      local_root=/var/www/html/XxXxXxXxX/uploads
      allow_writeable_chroot=YES
      download_enable=YES


      My ftp client connects correctly to the server and shows the contents of the folder but is unable to download any. The ftp-client answers "Connection refused". But even i try to find anything on /var/log/xferlog nothing is there. Nothing logged, file is empty.



      I even tried to create a file with the user in ssh console by "sudo su video" and "touch test.file" the file is generated but also unable to download.



      Researched here, over internet, forums, everywhere... can't find any solution.



      Thanks in advance for your help.










      share|improve this question














      This is my firs question and I really did research through internet and here in stackoverflow. But nothing worked out.



      I have set up an FTP server in an AWS-EC2 instance following the current guide answered on this question:
      Setting up FTP on Amazon Cloud Server



      It worked out except that the scenario i need is quite different that for using folder as web folder:
      What I want is to have one specific ftp-user to access just one folder in the web server to download some videos that are recorded by users with PHP and JavaScript. The videos are correctly generated and ownership is apache:apache



      Video folder is: /var/www/html/XXXXX/uploads and has 775 permisions



      I have an .htaccess file to prevent web access to folder and directory listing:



      sudo cat .htaccess 
      # secure .htaccess file
      <Files .htaccess>
      Order allow,deny
      Deny from all
      </Files>
      # disable directory browsing
      Options All -Indexes
      # prevent folder listing
      IndexIgnore *


      I added the user "video" to the apache group as explained in the guide (usermod -a -G apache video)



      This is my VSFTPD conf file:



      sudo cat /etc/vsftpd/vsftpd.conf 
      anonymous_enable=NO
      local_enable=YES
      write_enable=YES
      local_umask=022
      dirmessage_enable=YES
      xferlog_enable=YES
      connect_from_port_20=YES
      xferlog_file=/var/log/xferlog
      chroot_local_user=YES
      listen=NO
      listen_ipv6=YES
      pam_service_name=vsftpd
      userlist_enable=YES
      tcp_wrappers=YES
      pasv_enable=YES
      pasv_min_port=1024
      pasv_max_port=1048
      pasv_address=XX.XXX.XXX.XXX
      local_root=/var/www/html/XxXxXxXxX/uploads
      allow_writeable_chroot=YES
      download_enable=YES


      My ftp client connects correctly to the server and shows the contents of the folder but is unable to download any. The ftp-client answers "Connection refused". But even i try to find anything on /var/log/xferlog nothing is there. Nothing logged, file is empty.



      I even tried to create a file with the user in ssh console by "sudo su video" and "touch test.file" the file is generated but also unable to download.



      Researched here, over internet, forums, everywhere... can't find any solution.



      Thanks in advance for your help.







      apache amazon-web-services amazon-ec2 amazon-linux vsftpd






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 15 '18 at 15:02









      KikoKiko

      12




      12






















          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          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%2fstackoverflow.com%2fquestions%2f53322275%2fproblen-with-vsftpd-cant-download-files%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • 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%2fstackoverflow.com%2fquestions%2f53322275%2fproblen-with-vsftpd-cant-download-files%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







          這個網誌中的熱門文章

          What does pagestruct do in Eviews?

          Dutch intervention in Lombok and Karangasem

          Channel Islands