Страница 1 из 1

pure-ftpd и mysql

Добавлено: 2011-04-12 10:58:18
tom.cat
Всем привет.
Есть проблема с авторизацией виртуального пользователя.
Что на чем стоит:

Код: Выделить всё

# uname -a
FreeBSD infoblog.ws 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Fri Feb 18 02:24:46 UTC 2011     root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
Версия ftp сервера:

Код: Выделить всё

pure-ftpd-1.0.29_1  A small, easy to set up, fast and very secure FTP server
Мускул:

Код: Выделить всё

mysql-server-5.1.56
Имеется база с пользователями. В базе есть 4 пользователя, которые спокойно заходят на фтп без каких-либо проблем.
Вчера добавил еще одного пользователя. При логине вываливается ошибка:

Код: Выделить всё

Связь с фтп.
220---------- Welcome to Pure-FTPd [privsep] ----------
220-You are user number 2 of 50 allowed.
220-Local time is now 11:55. Server port: 21.
220 You will be disconnected after 15 minutes of inactivity.
Пользователь (фтп:(none)): user
331 User user OK. Password required
Пароль:
530 Login authentication failed
Сбой входа.
Пробовал менять пароль - бесполезно. Не могу понять в чем дело.
Есть какие-нить идеи?

Re: pure-ftpd и mysql

Добавлено: 2011-04-14 16:06:57
Alex Keda
ну, там, базу показать конфиги?
телепаты все поубивались об стены, не выдержав колоссальной нагрузки

Re: pure-ftpd и mysql

Добавлено: 2011-04-15 9:41:01
tom.cat
Итак. Ставил по твоей статье. Конфиги:
pureftpd-mysql.conf

Код: Выделить всё

# 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     /tmp/mysql.sock


# Mandatory : user to bind the server as.

MYSQLUser      dbowner


# Mandatory : user password. You must have a password.

MYSQLPassword  dbpasswd


# Mandatory : database to open.

MYSQLDatabase   pure-ftpd


# 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      md5


# 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 `users` WHERE `user`="\L" AND `active`='1'


# Query to execute in order to fetch the system user name or uid

MYSQLGetUID     SELECT `uid` FROM `users` WHERE `user`="\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 `users` WHERE `user`="\L"


# Optional : default GID - if set this overrides MYSQLGetGID

#MYSQLDefaultGID 1000


# Query to execute in order to fetch the home directory

MYSQLGetDir     SELECT `home` FROM `users` WHERE `user`="\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 : 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 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

Вот скрин базы
ftp.JPG
база
На скрине 5-й юзер никак не может залогиниться.

Re: pure-ftpd и mysql

Добавлено: 2011-04-28 13:46:23
tom.cat
Никто не сталкивался с такой проблемой?

Re: pure-ftpd и mysql

Добавлено: 2011-05-04 13:08:32
skeletor
Включи логгирование sql-запросов. Похоже, что либо он не может найти юзера либо выдаётся больше одной строки.

Re: pure-ftpd и mysql

Добавлено: 2011-05-05 10:05:38
tom.cat

Код: Выделить всё

110505 10:57:09    12 Connect   ftpd@localhost on ftpd
                   12 Query     SELECT `password` FROM `users` WHERE `user`="user" AND `active`='1'
                   12 Quit
Вот логи мускула.
А это /var/log/xferlog

Код: Выделить всё

May 5 10:34:25 server pure-ftpd: (?@95.27.159.28) [INFO] New connection from 95.27.159.28
May 5 10:34:42 server pure-ftpd: (?@95.27.159.28) [WARNING] Authentication failed for user [user]

Re: pure-ftpd и mysql

Добавлено: 2011-05-05 10:13:57
skeletor
А у него active='1'? Если создать 6-го, 7-го юзера их пустит?

Re: pure-ftpd и mysql

Добавлено: 2011-05-05 10:24:36
tom.cat
Но у меня тоже active='1'

Код: Выделить всё

110505 11:22:14   144 Connect   ftpd@localhost on ftpd
                  144 Query     SELECT `password` FROM `users` WHERE `user`="me" AND `active`='1'
                  144 Query     SELECT `uid` FROM `users` WHERE `user`="me"
                  144 Query     SELECT `gid` FROM `users` WHERE `user`="me"
                  144 Query     SELECT `home` FROM `users` WHERE `user`="me"
                  144 Query     SELECT `QuotaFiles` FROM `users` WHERE `user`="me"
                  144 Query     SELECT `QuotaSize` FROM `users` WHERE `user`="me"
                  144 Query     SELECT `ULBandwidth` FROM `users` WHERE `user`="me"
                  144 Query     SELECT `DLBandwidth` FROM users WHERE `user`="me"
                  144 Quit

Re: pure-ftpd и mysql

Добавлено: 2011-05-05 10:28:53
tom.cat
ID в таблице у всех юзеров разные. Возможно проблема из-за домашней директории анонимного?! Так как я добавил пользователя и назначил ему поддиректорию анонима... запутался я в общем

Re: pure-ftpd и mysql

Добавлено: 2011-05-05 10:33:44
skeletor
Попробуй другую папку указать

Re: pure-ftpd и mysql

Добавлено: 2011-05-05 10:38:04
tom.cat
Вот вся фишка в том, что с другой работает)))) а мне как раз надо, чтобы именно этот юзер имел права на эту подпапку на запись.... хочу обойти это.

Re: pure-ftpd и mysql

Добавлено: 2011-05-05 11:00:37
skeletor
Может с правами что-то не так?

Re: pure-ftpd и mysql

Добавлено: 2011-05-05 11:38:59
FreeBSP
в соседней теме я выкладывал патч для вебморды
слеш (/) попробуй поставь в конце пути, чтобы хомяк был /data/ftpd/

Re: pure-ftpd и mysql

Добавлено: 2011-05-05 12:37:50
tom.cat
skeletor писал(а):Может с правами что-то не так?
Права от анонимуса стоят, в базе тоже такие.
FreeBSP писал(а):в соседней теме я выкладывал патч для вебморды
слеш (/) попробуй поставь в конце пути, чтобы хомяк был /data/ftpd/
Попробовал и для анонимуса и для нового юзера... не работает

Код: Выделить всё

220---------- Welcome to Pure-FTPd [privsep] ----------
220-You are user number 2 of 50 allowed.
220-Local time is now 13:33. Server port: 21.
220 You will be disconnected after 15 minutes of inactivity.
Пользователь (server:(none)): user
331 User user OK. Password required
Пароль:
530 Login authentication failed
Сбой входа.