530 Login authentication failed

Discussion in 'General' started by shahab karimi, Mar 9, 2017.

  1. shahab karimi

    shahab karimi New Member

    I have installed a fresh copy of Ispconfig latest version 3.1 on an Ubuntu 16.04 and I have problems with ftp login
    what have I done so far :
    enabling pureftpd debug mode with the output :
    Code:
    root@hypo:~# tail -n 100 /var/log/syslog
    Mar  9 22:41:32 hypo systemd[1]: Started Terminate Plymouth Boot Screen.
    Mar  9 22:41:32 hypo systemd[1]: Started Set console scheme.
    Mar  9 22:41:32 hypo systemd[1]: Started Fail2Ban Service.
    Mar  9 22:41:32 hypo apache2[1297]:  *
    Mar  9 22:41:32 hypo systemd[1]: Started LSB: Apache2 web server.
    Mar  9 22:41:33 hypo mysql[1304]:    ...done.
    Mar  9 22:41:33 hypo systemd[1]: Started LSB: Start and stop the mysql database                                                                                                                                                              server daemon.
    Mar  9 22:41:33 hypo systemd[1]: Starting pure-ftpd-mysql.service...
    Mar  9 22:41:33 hypo /etc/mysql/debian-start[1672]: Upgrading MySQL tables if ne                                                                                                                                                             cessary.
    Mar  9 22:41:33 hypo /etc/mysql/debian-start[1676]: /usr/bin/mysql_upgrade: the                                                                                                                                                              '--basedir' option is always ignored
    Mar  9 22:41:33 hypo /etc/mysql/debian-start[1676]: Looking for 'mysql' as: /usr                                                                                                                                                             /bin/mysql
    Mar  9 22:41:33 hypo /etc/mysql/debian-start[1676]: Looking for 'mysqlcheck' as:                                                                                                                                                              /usr/bin/mysqlcheck
    Mar  9 22:41:33 hypo /etc/mysql/debian-start[1676]: Version check failed. Got th                                                                                                                                                             e following error when calling the 'mysql' command line client
    Mar  9 22:41:33 hypo /etc/mysql/debian-start[1676]: ERROR 1045 (28000): Access d                                                                                                                                                             enied for user 'root'@'localhost' (using password: NO)
    Mar  9 22:41:33 hypo /etc/mysql/debian-start[1676]: FATAL ERROR: Upgrade failed
    Mar  9 22:41:33 hypo /etc/mysql/debian-start[1694]: Checking for insecure root a                                                                                                                                                             ccounts.
    Mar  9 22:41:33 hypo mysql[1304]: ERROR 1045 (28000): Access denied for user 'ro                                                                                                                                                             ot'@'localhost' (using password: NO)
    Mar  9 22:41:33 hypo pure-ftpd-mysql[1667]: Starting ftp server: Running: /usr/s                                                                                                                                                             bin/pure-ftpd-mysql-virtualchroot -l mysql:/etc/pure-ftpd/db/mysql.conf -b -D -Y                                                                                                                                                              1 -E -8 UTF-8 -A -u 1000 -O clf:/var/log/pure-ftpd/transfer.log -H -J ALL:!aNUL                                                                                                                                                             L:!SSLv3 -B
    MB
    Mar  9 22:46:49 hypo systemd[1]: Started pure-ftpd-mysql.service.
    Mar  9 22:47:01 hypo CRON[2261]: (root) CMD (/usr/local/ispconfig/server/server.                                                                                                                                                             sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cro                                                                                                                                                             n.log; done)
    Mar  9 22:47:01 hypo CRON[2262]: (root) CMD (/usr/local/ispconfig/server/cron.sh                                                                                                                                                              2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.                                                                                                                                                             log; done)
    
    secondly I checked the ispconfig database to see if the username actually exists , and it does exist but the error I am getting on my ftp client is

    Code:
    Status:    TLS connection established.
    Command:    USER default2
    Response:    331 User default2 OK. Password required
    Command:    PASS ******
    Response:    530 Login authentication failed
    
    my DontResolve is also yes

    service mysql and pureftpd are both running without any errors

    username that is created is 1 , the prefix is default so I am trying to login with default1 and the assigned password
    the password in mysql database is a varchar64 which looks encrypted but since it is not MD5 I do not know how to decrypt and see if it is actually the password I have set , but I do not have a lot of suspension over that

    Thanks
     
  2. shahab karimi

    shahab karimi New Member

    this is my /etc/pure-ftpd/db/mysql.conf

    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   mypassword
    
    
    # Mandatory : database to open.
    
    MYSQLDatabase   ispdb
    
    
    # Mandatory : how passwords are stored
    # Valid values are : "cleartext", "crypt", "md5" and "password"
    # ("password" = MySQL password() function)
    # You can also use "any" to try "crypt", "md5" *and* "password"
    
    MYSQLCrypt      crypt
    
    
    # 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 active = 'y' AND server_id = '1' AND username="\L"
    
    
    # Query to execute in order to fetch the system user name or uid
    
    MYSQLGetUID     SELECT uid FROM ftp_user WHERE active = 'y' AND server_id = '1' AND username="\L"
    
    
    # Optional : default UID - if set this overrides MYSQLGetUID
    
    #MYSQLDefaultUID 1000
    
    
    # Query to execute in order to fetch the system user group or gid
    
    MYSQLGetGID     SELECT gid FROM ftp_user WHERE active = 'y' AND server_id = '1' AND username="\L"
    
    
    # Optional : default GID - if set this overrides MYSQLGetGID
    
    #MYSQLDefaultGID 1000
    
    
    # Query to execute in order to fetch the home directory
    
    MYSQLGetDir     SELECT dir FROM ftp_user WHERE active = 'y' AND server_id = '1' AND username="\L"
    
    
    # Optional : query to get the maximal number of files
    # Pure-FTPd must have been compiled with virtual quotas support.
    
    MySQLGetQTAFS  SELECT quota_files FROM ftp_user WHERE active = 'y' AND server_id = '1' AND quota_files != '-1' AND username="\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 quota_size FROM ftp_user WHERE active = 'y' AND server_id = '1' AND quota_files != '-1' AND username="\L"
    
    
    # Optional : ratios. The server has to be compiled with ratio support.
    
    MySQLGetRatioUL SELECT ul_ratio FROM ftp_user WHERE active = 'y' AND server_id = '1' AND quota_files != '-1' AND username="\L"
    MySQLGetRatioDL SELECT dl_ratio FROM ftp_user WHERE active = 'y' AND server_id = '1' AND quota_files != '-1' AND username="\L"
    
    
    # Optional : bandwidth throttling.
    # The server has to be compiled with throttling support.
    # Values are in KB/s .
    
    MySQLGetBandwidthUL SELECT ul_bandwidth FROM ftp_user WHERE active = 'y' AND server_id = '1' AND quota_files != '-1' AND username="\L"
    MySQLGetBandwidthDL SELECT dl_bandwidth FROM ftp_user WHERE active = 'y' AND server_id = '1' AND quota_files != '-1' AND username="\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 upgraded your tables to transactionnal tables (Gemini,
    # BerkeleyDB, Innobase...), you can enable SQL transactions to
    # avoid races. Leave this commented if you are using the
    # traditionnal MyIsam databases or old (< 3.23.x) MySQL versions.
    
    MySQLTransactions On
    When I was installing ispconfig I changed db name to ispdb , I made the change in the file too , yet no result
     
  3. shahab karimi

    shahab karimi New Member

    So for the reference , I changed the part
    Code:
    MYSQLUser       ispconfig
    
    
    # Mandatory : user password. You must have a password.
    
    MYSQLPassword   mypassword
    to my actuall username and password which in my case was
    username root and password 123456 , since it is a test server
    and restarted the services , and voila , I wonder if it is safe tho , thanks for providing me with you valuable insight
     
  4. shahab karimi

    shahab karimi New Member

    It also occurred to me that for some reason on Ubuntu 16.04 you have to rename mysqlserver 127.0.01 to localhost , I don't know what difference there is between them but on my second fresh installation , it happened again and I fixed it this time only by changing the local ip to localhost
     
  5. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

Share This Page