PDA

View Full Version : Pureftpd login problem


mho
29th December 2007, 12:07
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)

falko
30th December 2007, 16:41
Any errors in your log files? What's the exact login failure message you get?

mho
7th January 2008, 10:49
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: (?@**.hrnxx13.adsl-dhcp.tele.dk) [INFO] New connection from **.hrnxx13.adsl-dhcp.tele.dk
Dec 30 00:46:42 guldsrv pure-ftpd: (?@**.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: (?@**.hrnxx13.adsl-dhcp.tele.dk) [INFO] PAM_RHOST enabled. Getting the peer address
Dec 30 00:46:44 guldsrv pure-ftpd: (?@**.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.

falko
8th January 2008, 17:46
What's in your /etc/pure-ftpd/db/mysql.conf? Should look like this:
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")

mho
9th January 2008, 16:33
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.

falko
10th January 2008, 16:06
Dec 30 00:46:42 guldsrv pure-ftpd: (?@**.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.*")]
To me it looks as if a bracket is missing in the SQL statement. Should be

SELECT Dir FROM ftpd WHERE User="webhost" AND status="1" AND (ipaccess = "*" AND (ipaccess = "*" OR ipaccess LIKE "87.49.60.*"))

mho
24th January 2008, 21:17
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..)

falko
25th January 2008, 17:10
Do you mean /etc/pure-ftpd/db/mysql.conf?

iyeat
27th January 2008, 09:51
What is the output of your MySQL tables? Are you using the MD5() function to encrypt your password?