Pureftpd login problem

Discussion in 'HOWTO-Related Questions' started by mho, Dec 29, 2007.

  1. mho

    mho New Member

    Hello.

    First a warm thanks from Denmark. I really like the guides from this website.

    First with a empty computer, I followed the perfect_setup_debian_etch guide, from chapter 1 to 7, 10 to 13 and 15 to 18.

    It works, apache, mysql, phpmyadmin and so on. Works really good.

    Then I followed the debian_etch_virtual_hosting_pureftpd_mysql_quota, from chapter 3 (the system has mysql installed from above guide).

    This works also pretty nice, but - when I adds a user via mysql and tries to login with the specified username/password - I get a login failure. It seems that the ftp server aproves my username but not the password.

    I did a guide walk through several times, but all information seems to follow the guide.

    Does any one have a solution.

    (excuse my bad english)
     
  2. falko

    falko Super Moderator ISPConfig Developer

    Any errors in your log files? What's the exact login failure message you get?
     
  3. mho

    mho New Member

    Hello, sorry for the long answer.

    Happy newyear.

    My sys log contains this, after a failed login.

    Dec 30 00:46:42 guldsrv pure-ftpd: ([email protected]**.hrnxx13.adsl-dhcp.tele.dk) [INFO] New connection from **.hrnxx13.adsl-dhcp.tele.dk
    Dec 30 00:46:42 guldsrv pure-ftpd: ([email protected]**.hrnxx13.adsl-dhcp.tele.dk) [WARNING] Wrong SQL parameters : [SELECT Dir FROM ftpd WHERE User="webhost" AND status="1" AND (ipaccess = "*" AND (ipaccess = "*" OR ipaccess LIKE "87.49.60.*")]
    Dec 30 00:46:42 guldsrv pure-ftpd: ([email protected]**.hrnxx13.adsl-dhcp.tele.dk) [INFO] PAM_RHOST enabled. Getting the peer address
    Dec 30 00:46:44 guldsrv pure-ftpd: ([email protected]**.hrnxx13.adsl-dhcp.tele.dk) [WARNING] Authentication failed for user [webhost]

    Could it be, that my group (ftpgroup) and user (ftpuser) dosen't have the rights to access the /users/ directory to make its own for the user.

    Groups, users and rights are not my strongest, would you take the time to guide me through.
     
  4. falko

    falko Super Moderator ISPConfig Developer

    What's in your /etc/pure-ftpd/db/mysql.conf? Should look like this:
    Code:
    MYSQLSocket      /var/run/mysqld/mysqld.sock
    #MYSQLServer     localhost
    #MYSQLPort       3306
    MYSQLUser       pureftpd
    MYSQLPassword   ftpdpass
    MYSQLDatabase   pureftpd
    #MYSQLCrypt md5, cleartext, crypt() or password() - md5 is VERY RECOMMENDABLE uppon cleartext
    MYSQLCrypt      md5
    MYSQLGetPW      SELECT Password FROM ftpd WHERE User="\L" AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
    MYSQLGetUID     SELECT Uid FROM ftpd WHERE User="\L" AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
    MYSQLGetGID     SELECT Gid FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
    MYSQLGetDir     SELECT Dir FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
    MySQLGetBandwidthUL SELECT ULBandwidth FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
    MySQLGetBandwidthDL SELECT DLBandwidth FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
    MySQLGetQTASZ   SELECT QuotaSize FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
    MySQLGetQTAFS   SELECT QuotaFiles FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
     
  5. mho

    mho New Member

    Yes, and to make sure - I copied the one you posted.

    Still same error.

    The group and user has uid/gid 2008 - same as the value in the database. After a login try that has error, I checked my home directory - and the ftp has placed my home dir correct.

    But the ftp still dosent let me in.
     
  6. falko

    falko Super Moderator ISPConfig Developer

    To me it looks as if a bracket is missing in the SQL statement. Should be

    Code:
    SELECT Dir FROM ftpd WHERE User="webhost" AND status="1" AND (ipaccess = "*" AND (ipaccess = "*" OR ipaccess LIKE "87.49.60.*")[B][COLOR="Red"])[/COLOR][/B]
     
  7. mho

    mho New Member

    Yeah I got that.

    I've got it working, but after a 'unwanted' reboot and reinstalll off the server - I got to start again.

    Now I followed the guide.. but still the password dosen't seems to be correct.

    Where to place the information you wrote? :) (don't recall.. it's been a while..)
     
  8. falko

    falko Super Moderator ISPConfig Developer

    Do you mean /etc/pure-ftpd/db/mysql.conf?
     
  9. iyeat

    iyeat New Member

    What is the output of your MySQL tables? Are you using the MD5() function to encrypt your password?
     

Share This Page