[Sysadmins] vsftpd pam-mysql problem

Novikov Yuriy yurik на opencom.ru
Пт Дек 11 08:04:55 UTC 2009


Добрый день,
поиск и гугление не к чему не привели,
Столкнулся с проблемой авторизации vsftpd через mysql
создал базу, дал права пользователю vsftpd
написал конфиг:
Код:

anonymous_enable=NO
local_enable=YES
check_shell=NO
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
xferlog_file=/var/log/vsftpd.log
log_ftp_protocol=YES
connect_from_port_20=YES
nopriv_user=vsftpd
chroot_local_user=YES
#secure_chroot_dir=/var/run/vsftpd
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/vsftpd.pem
guest_enable=YES
guest_username=vsftpd
local_root=/var/vsftpd/$USER
user_sub_token=$USER
virtual_use_local_privs=YES
user_config_dir=/etc/vsftpd/vsftpd_user_conf


в /etc/pam.d/vsftpd
Код:

auth required pam_mysql.so user=vsftpd passwd=xxx host=localhost db=vsftpd table=accounts usercolumn=username passwdcolumn=pass crypt=2 verbose=1 debug=1
account required pam_mysql.so user=vsftpd passwd=xxx host=localhost db=vsftpd table=accounts usercolumn=username passwdcolumn=pass crypt=2 verbose=1 debug=1

проверял от разных пользователей в том числе от рута и с разными типами 
шифрования и без...
результат один.
530 Login incorrect

привожу логи
Код:

Dec 11 09:52:16 alta xinetd[23494]: START: ftp pid=24927 from=xx.xx.xx.xx
Dec 11 09:52:16 alta vsftpd: pam_mysql - option verbose is set to "1"
Dec 11 09:52:16 alta vsftpd: pam_mysql - option debug is set to "1"
Dec 11 09:52:17 alta vsftpd: pam_mysql - pam_mysql_close_db() called.
Dec 11 09:52:17 alta vsftpd: pam_mysql - pam_sm_authenticate() called.
Dec 11 09:52:17 alta vsftpd: pam_mysql - pam_mysql_open_db() called.
Dec 11 09:52:17 alta vsftpd: pam_mysql - pam_mysql_open_db() returning 0.
Dec 11 09:52:17 alta vsftpd: pam_mysql - pam_mysql_check_passwd() called.
Dec 11 09:52:17 alta vsftpd: pam_mysql - pam_mysql_format_string() called
Dec 11 09:52:17 alta vsftpd: pam_mysql - pam_mysql_quick_escape() called.
Dec 11 09:52:17 alta vsftpd: pam_mysql - SELECT pass FROM accounts WHERE username = 'testuser'
Dec 11 09:52:17 alta vsftpd: pam_mysql - pam_mysql_check_passwd() returning 6.
Dec 11 09:52:17 alta vsftpd: pam_mysql - pam_mysql_sql_log() called.
Dec 11 09:52:17 alta vsftpd: pam_mysql - pam_mysql_sql_log() returning 0.
Dec 11 09:52:17 alta vsftpd: pam_mysql - pam_mysql_converse() called.
Dec 11 09:52:17 alta vsftpd: pam_mysql - pam_sm_authenticate() returning 3.
Dec 11 09:52:17 alta vsftpd: pam_mysql - pam_mysql_release_ctx() called.
Dec 11 09:52:17 alta vsftpd: pam_mysql - pam_mysql_destroy_ctx() called.
Dec 11 09:52:17 alta vsftpd: pam_mysql - pam_mysql_close_db() called.



и /var/log/vsftpd.log
Код:

Fri Dec 11 09:54:37 2009 [pid 25008] CONNECT: Client "xxx"
Fri Dec 11 09:54:37 2009 [pid 25008] FTP response: Client "xxx", "220 (vsFTPd 2.0.6)"
Fri Dec 11 09:54:37 2009 [pid 25008] FTP command: Client "xxx", "FEAT"
Fri Dec 11 09:54:37 2009 [pid 25008] FTP response: Client "xxx", "211-Features:"
Fri Dec 11 09:54:37 2009 [pid 25008] FTP response: Client "xxx", " EPRT??"
Fri Dec 11 09:54:37 2009 [pid 25008] FTP response: Client "xxx", " EPSV??"
Fri Dec 11 09:54:37 2009 [pid 25008] FTP response: Client "xxx", " MDTM??"
Fri Dec 11 09:54:37 2009 [pid 25008] FTP response: Client "xxx", " PASV??"
Fri Dec 11 09:54:37 2009 [pid 25008] FTP response: Client "xxx", " REST STREAM??"
Fri Dec 11 09:54:37 2009 [pid 25008] FTP response: Client "xxx", " SIZE??"
Fri Dec 11 09:54:37 2009 [pid 25008] FTP response: Client "xxx", " TVFS??"
Fri Dec 11 09:54:37 2009 [pid 25008] FTP response: Client "xxx", " UTF8??"
Fri Dec 11 09:54:37 2009 [pid 25008] FTP response: Client "xxx", "211 End"
Fri Dec 11 09:54:37 2009 [pid 25008] FTP command: Client "xxx", "OPTS UTF8 ON"
Fri Dec 11 09:54:37 2009 [pid 25008] FTP response: Client "xxx", "200 Always in UTF8 mode."
Fri Dec 11 09:54:37 2009 [pid 25008] FTP command: Client "xxx", "USER testuser"
Fri Dec 11 09:54:37 2009 [pid 25008] [testuser] FTP response: Client "xxx", "331 Please specify the password."
Fri Dec 11 09:54:37 2009 [pid 25008] [testuser] FTP command: Client "xxx", "PASS <password>"
Fri Dec 11 09:54:38 2009 [pid 25007] [testuser] FAIL LOGIN: Client "xxx"
Fri Dec 11 09:54:39 2009 [pid 25008] [testuser] FTP response: Client "xxx", "530 Login incorrect."
Fri Dec 11 09:54:39 2009 [pid 25008] FTP command: Client "xxx", "PWD"
Fri Dec 11 09:54:39 2009 [pid 25008] FTP response: Client "xxx", "530 Please login with USER and PASS."


Хотелось бы услышать Ваши мнения на сей счёт.


Подробная информация о списке рассылки Sysadmins