Pure Ftpd MySQL authorisation problem

Discussion in 'General' started by davebamford, Jul 2, 2010.

  1. davebamford

    davebamford New Member

    Hi
    Please excuse me if this has been answered but I have searched the forums and cannot fix this problem.
    I have installed ispconfig3 on Debian Squeeze running on a virtual machine using KVM and everything seems to work except for pureftp. I have tried various fixes suggested her but cannot get a user to authorise with sql. Unix users can log in,
    Auth is set as follows
    30mysql 65unix 70pam
    Dontresolve is set to yes
    PAMauthentication I have changed to No
    and in the mysql.conf file I have tried 127.0.0.1 and localhost as the sql server
    also I have changed the encryption from crypt to any

    I can access the table ftp_user and see the username and an encrypted password
    and the database username and password in the mysql.conf file work OK.

    Please help I am now totally stuck.

    Thanks

    Dave
     
  2. falko

    falko Super Moderator ISPConfig Developer

    Any errors in your logs?
     
  3. davebamford

    davebamford New Member

    logs

    Here is an extract from the logs when I try to locally log in with pureftp.
    I only just noticed that there is a message about the SQL server being down, yet I can
    manually connect to the sql database using mysql -p xxx
    >use dbispconfig
    >select * from ftp_user;
    this displays the table

    Why is pureftp trying to log in as root, the mysql.conf specifies ispconfig as the user?



    Jul 3 12:46:15 maggie pure-ftpd: (?@localhost) [INFO] New connection from localhost
    Jul 3 12:46:25 maggie pure-ftpd: (?@localhost) [ERROR] The SQL server seems to be down [Access denied for user 'root'@'localhost' (using password: YES)]
    Jul 3 12:46:25 maggie pure-ftpd: (?@localhost) [INFO] PAM_RHOST enabled. Getting the peer address
    Jul 3 12:46:33 maggie pure-ftpd: (?@localhost) [WARNING] Authentication failed for user [testdave]
    Jul 3 12:46:35 maggie pure-ftpd: (?@localhost) [INFO] Logout.
     
  4. davebamford

    davebamford New Member

    Just an update
    Pureftp does not seem to be reading the mysql.conf file

    here is the contents of auth

    root@maggie:/etc/pure-ftpd/auth# ls
    30mysql 65unix 70pam
    root@maggie:/etc/pure-ftpd/auth# more 30mysql
    /etc/pure-ftpd/db/mysql.conf
    root@maggie:/etc/pure-ftpd/auth#

    could it be a permissions problem? I tried chmod 777 mysql.conf

    and here are the contents of conf
    root@maggie:/etc/pure-ftpd/conf# more *
    ::::::::::::::
    AltLog
    ::::::::::::::
    clf:/var/log/pure-ftpd/transfer.log
    ::::::::::::::
    BrokenClientsCompatibility
    ::::::::::::::
    yes
    ::::::::::::::
    ChrootEveryone
    ::::::::::::::
    yes
    ::::::::::::::
    DontResolve
    ::::::::::::::
    yes
    ::::::::::::::
    FSCharset
    ::::::::::::::
    UTF-8
    ::::::::::::::
    MinUID
    ::::::::::::::
    1000
    ::::::::::::::
    MySQLConfigFile
    ::::::::::::::
    /etc/pure-ftpd/db/mysql.conf
    ::::::::::::::
    NoAnonymous
    ::::::::::::::
    yes
    ::::::::::::::
    PAMAuthentication
    ::::::::::::::
    no
    ::::::::::::::
    PureDB
    ::::::::::::::
    /etc/pure-ftpd/pureftpd.pdb
    ::::::::::::::
    UnixAuthentication
    ::::::::::::::
    no
    root@maggie:/etc/pure-ftpd/conf#
     
  5. davebamford

    davebamford New Member

    Solved!!!

    Still not sure what I did to fix it, but a compete uninstall of pure-ftp-mysql and
    pure-ftp-common then a reinstall and put the conf files back from a copy and its
    working.
    Phew!
    :):D
     
  6. astuto

    astuto New Member

    Hi

    I've tried everything but still not working. The log:
    [ERROR] The SQL server seems to be down [Access denied for user 'root'@'localhost' (usi
    ng password: YES)]

    And yes, mysql is working. pure-ftpd tries to access database with 'root' user, while it should be using 'ispconfig'?

    I don't know what else to do, reinstalling doesn't seems to change anything.

    Please help,

    Thanks!
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    If this is a ispconfig server, then the mysql must be ispconfig.

    Which tutorial did you use to install the server?
     
  8. astuto

    astuto New Member

  9. falko

    falko Super Moderator ISPConfig Developer

    When do you get that message?
     
  10. astuto

    astuto New Member

    Hi,

    i've just figured out what's happening. It seems that the first configuration of pure-ftpd-mysql doesn't work as expected: the generated login credeantials in /etc/pure-ftpd/db/mysql.conf are incorrect. OK, so i've changed the credentials to user ispconfig and real password... and here comes the strange part: restarting pure-ftpd with pure-ftpd-control restart doesn't stop the daemon properly (neither with pure-ftpd-control stop), so a "fake" restart occurs (with no new real credentials). I've killed the daemon, started it again... and it works.

    Restarting the server should work, but I haven't tried.

    EDIT: the error occurs when accesing ftp, because pure-ftpd tries to read db with incorrect credentials.
    Hope it helps,
    thanks
     
    Last edited: Oct 28, 2010
  11. yobdabr

    yobdabr New Member


    THE SOLUTION:
    pkill pure-ftpd
    configure your /etc/pure-ftpd/db/mysql.conf .. already head
    /etc/init.d/pure-ftpd-mysql start

    and connect your server via FTP :)
     
  12. at79

    at79 New Member

  13. urgensherpa

    urgensherpa New Member

    Thanks guys it worked for me

    =============================
    here is what i did to fix , i was on process to migrate ispconfig 3 from old ubuntu12.04(HDD problem on XEN) to new ubuntu 12.04(openvz container).
    I had copied the content from old server
    (/usr/local/ispconfig/) to new server
    which also contained the password of ispconfig(mysql user) in
    (/usr/local/ispconfig/server/lib/config.inc.php) file
    at line 67 which looks similar to this =>

    $conf['db_password'] = 'opieudjduejdkdjdiuae29fd51a763db';

    i copied the password 'opieudjduejdkdjdiuae29fd51a763db' and replaced the ispconfig password in the

    file (/etc/pure-ftpd/db/mysql.conf) which looks similar to =>

    MYSQLPassword opieudjduejdkdjdiuae29fd51a763db

    then i restarted:-
    /etc/init.d/pure-ftpd-mysql restart

    and bamm!!! ftp connection worked !!
     

Share This Page