FTP Login authentication failed

Discussion in 'Installation/Configuration' started by MadWalnut, Sep 11, 2017.

  1. MadWalnut

    MadWalnut New Member

    Hi,

    I'm having some issues with FTP. While Following the tutorial (https://www.howtoforge.com/tutorial...9-stretch-apache-bind-dovecot-ispconfig-3-1/1) I accidentally skipped installing pureftpd. I noticed this after ISPConfig was up and running. So I installed pureftpd according to the tutorial afterwards. ISPConfig now says everything is fine with FTP.
    I then created a website and a FTP user for this website (default client). But it's not possible to connect via my FTP Client. FileZilla says:
    Code:
    Status:    Resolving address of mydomain.tld
    Status:    Connecting to 123.123.123.123:21...
    Status:    Connection established, waiting for welcome message...
    Status:    Initializing TLS...
    Status:    Verifying certificate...
    Status:    TLS connection established.
    Command:    USER defaulttest
    Response:    331 User defaulttest OK. Password required
    Command:    PASS *********
    Response:    530 Login authentication failed
    Error:    Critical error: Could not connect to server
    I enabled verbose logging for pureftpd and checked /var/log/syslog:
    Code:
    Sep 11 11:06:45 myvps pure-ftpd: ([email protected]) [INFO] New connection from server-access.myisp.com
    Sep 11 11:06:45 myvps pure-ftpd: ([email protected]) [DEBUG] Command [auth] [TLS]
    Sep 11 11:06:46 myvps pure-ftpd: ([email protected]) [INFO] TLS: Enabled TLSv1.2 with ECDHE-RSA-AES256-GCM-SHA384, 256 secret bits cipher
    Sep 11 11:06:46 myvps pure-ftpd: ([email protected]) [DEBUG] Command [user] [defaulttest]
    Sep 11 11:06:46 myvps pure-ftpd: ([email protected]) [DEBUG] Command [pass] [<*>]
    Sep 11 11:06:50 myvps pure-ftpd: ([email protected]) [WARNING] Authentication failed for user [defaulttest]
    Sep 11 11:06:50 myvps pure-ftpd: ([email protected]) [INFO] Logout.
    I think the problem comes from installing pureftpd AFTER ISPConfig. Seems like ISPConfig did not setup pureftpd at all afterwards, since I even had to manually edit /etc/pure-ftpd/db/mysql.conf for the database details (password, user, database name und table needed changes. I also edited the SQL commands (made them up by looking at the table)). Until then I was getting "wrong SQL password"-errors. So now I'm at the point where accessing the database seems to work fine, but FTP authentication still fails... I can also see my FTP-Users when I login into PHPMyAdmin and check the table "ftp_user". Please help :)

    Code:
    ##############################################
    #                                            #
    # Sample Pure-FTPd Mysql configuration file. #
    # See README.MySQL for explanations.         #
    #                                            #
    ##############################################
    
    
    # Optional : MySQL server name or IP. Don't define this for unix sockets.
    
    # MYSQLServer     127.0.0.1
    
    
    # Optional : MySQL port. Don't define this if a local unix socket is used.
    
    # MYSQLPort       3306
    
    
    # Optional : define the location of mysql.sock if the server runs on this host.
    
    MYSQLSocket      /var/run/mysqld/mysqld.sock
    
    
    # Mandatory : user to bind the server as.
    
    MYSQLUser       ispconfig
    
    
    # Mandatory : user password. You must have a password.
    
    MYSQLPassword   [the password I found in /usr/local/ispconfig/interface/lib/config.inc.php; it works in PHPMyAdmin]
    
    
    # Mandatory : database to open.
    
    MYSQLDatabase   dbispconfig
    
    
    # Mandatory : how passwords are stored
    # Valid values are : "cleartext", "scrypt", "crypt", "sha1", "md5", "password" $
    # ("password" = MySQL password() function, which is sha1(sha1(password)))
    
    MYSQLCrypt      scrypt
    
    # In the following directives, parts of the strings are replaced at
    # run-time before performing queries :
    #
    # \L is replaced by the login of the user trying to authenticate.
    # \I is replaced by the IP address the user connected to.
    # \P is replaced by the port number the user connected to.
    # \R is replaced by the IP address the user connected from.
    # \D is replaced by the remote IP address, as a long decimal number.
    #
    # Very complex queries can be performed using these substitution strings,
    # especially for virtual hosting.
    
    # Query to execute in order to fetch the password
    MYSQLGetPW      SELECT password FROM ftp_user WHERE username='\L'
    
    
    # Query to execute in order to fetch the system user name or uid
    MYSQLGetUID     SELECT sys_userid FROM ftp_user WHERE username='\L'
    
    
    # Optional : default UID - if set this overrides MYSQLGetUID
    
    #MYSQLDefaultUID 1000
    
    # Query to execute in order to fetch the home directory
    
    MYSQLGetDir     SELECT dir FROM ftp_user WHERE username='\L'
    
    
    # Optional : query to get the maximal number of files
    # Pure-FTPd must have been compiled with virtual quotas support.
    
    # MySQLGetQTAFS  SELECT QuotaFiles FROM users WHERE User='\L'
    
    
    # Optional : query to get the maximal disk usage (virtual quotas)
    # The number should be in Megabytes.
    # Pure-FTPd must have been compiled with virtual quotas support.
    
    # MySQLGetQTASZ  SELECT QuotaSize FROM users WHERE User='\L'
    # Optional : query to get the maximal disk usage (virtual quotas)
    # The number should be in Megabytes.
    # Pure-FTPd must have been compiled with virtual quotas support.
    
    # MySQLGetQTASZ  SELECT QuotaSize FROM users WHERE User='\L'
    
    
    # Optional : ratios. The server has to be compiled with ratio support.
    
    # MySQLGetRatioUL SELECT ULRatio FROM users WHERE User='\L'
    # MySQLGetRatioDL SELECT DLRatio FROM users WHERE User='\L'
    
    
    # Optional : bandwidth throttling.
    # The server has to be compiled with throttling support.
    # Values are in KB/s .
    # MySQLGetBandwidthUL SELECT ULBandwidth FROM users WHERE User='\L'
    # MySQLGetBandwidthDL SELECT DLBandwidth FROM users WHERE User='\L'
    
    
    # Enable ~ expansion. NEVER ENABLE THIS BLINDLY UNLESS :
    # 1) You know what you are doing.
    # 2) Real and virtual users match.
    
    # MySQLForceTildeExpansion 1
    
    # If you're using a transactionnal storage engine, you can enable SQL
    # transactions to avoid races. Leave this commented if you are using the
    # traditional MyIsam engine.
    
    # MySQLTransactions On

    Are there any errors in my /etc/pure-ftpd/db/mysql.conf? What else do I have to edit when setting up pureftpd manually? Or is there a way for ISPConfig to re-do the pureftpd-setup for me? I don't want to clean install my whole system (Debian Stretch x64 on a VPS).

    Thanks in advance.

    Edit: Or is there a way to reconfigure ISPConfig so it can detect the now installed pureftpd by itself and configure it? I tried using update.php but it just tells me that I already have the newest version of ISPConfig.
     
    Last edited: Sep 11, 2017
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    yes. Run:

    cd /tmp
    wget http://www.ispconfig.org/downloads/ISPConfig-3.1.6.tar.gz
    tar xvfz ISPConfig-3.1.6.tar.gz
    cd ispconfig3_install/install
    php -q update.php

    and choose yes when the updater asks you to reconfigure services.
     
    MadWalnut likes this.
  3. MadWalnut

    MadWalnut New Member

    I have no idea why my attempt executing update.php just ended in "no update needed"... But with re-downloading as you posted it worked like a charm and pureftpd is now correctly configured! I can now connect via FTP.

    Thank you very much!
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    You probably ran 'ispconfig_update.sh' command at the first attempt and this is a wrapper script around update.php that compares the installed version with the latest version to avoid duplicate downloads and updates.
     
    MadWalnut likes this.
  5. MadWalnut

    MadWalnut New Member

    You are right. I executed that script and it indeed was the one I tried at first attempt.
     

Share This Page