pure-ftpd error "ECONNREFUSED - Connection refused by server"

Discussion in 'Installation/Configuration' started by Masters of Media, Mar 14, 2021.

  1. Masters of Media

    Masters of Media Member HowtoForge Supporter

    I am trying to make pure-ftpd work on a Ubuntu 20.04 server in a multi-server setup. The server was setup according to the 'perfect server' setup. I can not get FTP working with the persistent errormessage "ECONNREFUSED - Connection refused by server" everytime I try to connect using a FTP client. Here's what I have checked sofar:
    • A FTP user has been setup in ISP, attached to the correct server and website.
    • pure-ftpd is set to listen to port 21 in pure-fptd.conf and port 21 is set in ufw.
    • Port 21 can be reached from the computer I am trying to connect to the server (done a portscan).
    • A passive port range has been defined in pure-fptd.conf (35000 35999) and this range is set in ufw.
    • The TLS option is set to 1.
    • Service pure-ftpd is running according to the command # service pure-ftp-mysql status.
    • According to command # netstat -tulpn , pure-ftpd is listening on port 21.
    • Tried various FTP clients wirth identical error message.
    I can't see what I've missed and yet I can not get coonnections over FTP.
    What could I be doing wrong ? Any help is much appreciated.
    Erik
     
    Last edited: Mar 14, 2021
  2. Masters of Media

    Masters of Media Member HowtoForge Supporter

    I also tried different portnumbers as well, this does not make a difference.
     
  3. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Any errors related to pure-ftpd in /var/log/syslog? Perhaps something like "Sorry, but that file doesn't exist: [/etc/ssl/private/pure-ftpd.pem]"?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Have you checked that there is no firewall or router in front of the server that might block the FTP ports. E.g. some data centers or cloud providers run firewalls in front of the hosted systems.
     
  5. Masters of Media

    Masters of Media Member HowtoForge Supporter

    Thank you Thom. There are no such lines in /var/log/syslog .
    Erik
     
  6. Masters of Media

    Masters of Media Member HowtoForge Supporter

    Thank you Till and I checked that too. The 'server firewall' as it is called by my provider is off.
    Erik
     
  7. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Please run
    Code:
    grep "pure-ftpd" /var/log/syslog
    and check if the output shows any errors.
     
  8. Masters of Media

    Masters of Media Member HowtoForge Supporter

    There are no errors in the output if I run this command. I tried a restart of pure-ftpd and several attempts to connect.
     
  9. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Is pure-ftpd running?
     
  10. Masters of Media

    Masters of Media Member HowtoForge Supporter

    Yes, if I restart pure-ftpd and then do a status check (# service pure-ftpd-mysql status) I get a status saying it is running. Also, # netstat -tulpn reports pure-ftpd is listening.
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    maybe try to use a commandline FTP client and connect from commandline of your server to localhost. That way, we can narrow down if it#s an issue with the ftp daemon or if there is an issue to allow connections to the server.
     
  12. Masters of Media

    Masters of Media Member HowtoForge Supporter

    Just tried #ftp localhost. Response: "ftp: connect: Connnection refused"
    It looks like a pure-ftpd issue then.
     
  13. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Have you done any custom config for pure-ftpd?

    Could you try doing a force update and reconfigure your services, so pure-ftpd is reconfigured?
    Code:
    ispconfig_update.sh --force
     
  14. Masters of Media

    Masters of Media Member HowtoForge Supporter

    I made a few changes in the config file: disabled anonymous FTP, added passive portnumbers and (as was suggested in one of the topics where the same error was discussed) added a passive IP).
    I'm happy to reconfigure but will that override any of the customizations I may have made for other services? Can I force reconfigure pure-ftpd only instead of all services?
     
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    Depends on how you made them. if you implemented the correctly by using conf-custom templates, then the changes are update-safe. if not, they will get oevrridden. But you must re-implement them update-safe anyway if you have not done that yet as you won't be able to install ISPConfig updates otherwise.

    No
     
  16. Masters of Media

    Masters of Media Member HowtoForge Supporter

    I have made some customisations in the vhost of one of the domains on this server. Can I safely reconfigure without having to redo those? And will this overwrite settings of the currently installed services? I.e., will I have to check all services afterwards for proper working?
     
  17. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    You should never change the vhost manually, use the Apache directives instead.

    Yes, you should if you made customizations. You can use conf-custom templates in the future to prevent this but you'll have to keep these up to date.
     
  18. Masters of Media

    Masters of Media Member HowtoForge Supporter

    Thanks for the warning and directions to a better solution.
     
  19. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    that looks to me more like the ftp service isn't running.

    try telnetting to port 21.
     

Share This Page