Компьютерный форум OSzone.net  

Компьютерный форум OSzone.net (http://forum.oszone.net/index.php)
-   Общий по FreeBSD (http://forum.oszone.net/forumdisplay.php?f=10)
-   -   ProFTPd + MySQL 530 Login Incorrect (http://forum.oszone.net/showthread.php?t=243426)

Призрак 26-09-2012 13:46 1995090

ProFTPd + MySQL 530 Login Incorrect
 
Здравствуйте, уважаемые участники дискуссии.

Операционная система FreeBSD 8.2

FTP сервер ProFTPd 1.3.4b

В общем прикрутил MySQL к ProFTPd как указано в этой статье

http://muff.kiev.ua/content/proftpd-...-kvotirovaniya

Занес в таблицу users пользователя как указано в статье (только поддержку квотирования не включал), по своему (жирным выделил то, что поменял) insert into users values (NULL,'test',ENCRYPT('qwerty'),'1003','14','/usr/data/pub','/sbin/nologin');

Данный пользователь отсутствует в системе. При попытке входа на FTP получаю веселенькую надпись 530 Login Incorrect, а в логе proftpd-serverlog вижу две веселых надписи:

Код:

Sep 26 15:12:25 hostname.ru proftpd[37247] ip_address (ip_address[ip_address]): FTP session opened.
Sep 26 15:12:25 hostname.ru proftpd[37247] ip_address (ip_address[ip_address]): USER anonymous: no such user found from ip_address [ip_address] to ip_address:21
Sep 26 15:12:25 hostname.ru proftpd[37247] ip_address (ip_address[ip_address]): FTP session closed.
Sep 26 15:12:25 hostname.ru proftpd[37248] ip_address (ip_address[ip_address]): FTP session opened.
Sep 26 15:12:31 hostname.ru proftpd[37248] ip_address (ip_address[ip_address]): USER test: no such user found from ip_address [ip_address] to ip_address:21
Sep 26 15:12:31 hostname.ru proftpd[37248] ip_address (ip_address[ip_address]): FTP session closed.

Получается, что виртуальный пользователь отказывается работать. Но в чем причина? Тем более мне крайне интересно, почему на FTP ломится автоматом анонимус? Я закомментировал в конфиге все что связано с анонимусом, т.к. он мне не нужен. Как сделать так, чтобы он вообще не ломился?

С системными пользователями все в порядке, они авторизируются и работают нормально, а вот виртуальных никак не удается прикрутить. Пожалуйста посоветуйте что делать, я уж все мануалы и статьи перерыл, бесполезно.

Вот конфигурационные файлы, выкладываю полностью.

proftpd.conf

Код:

#
# For more informations about Proftpd configuration
# look at : http://www.proftpd.org/
#
# This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use.  It establishes a single server
# and a single anonymous login.  It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.

ServerName                        "MYSERVER"
ServerType                        standalone
DefaultServer                        on
ServerIdent off
ShowSymlinks on
ScoreboardFile                /var/run/proftpd/proftpd.scoreboard
#TransferRate RETR,STOR,APPE 80
MaxClients 50 "sorry, limit is finished"
AllowStoreRestart        on
AllowRetrieveRestart        on
PassivePorts 1024 2048
TimeoutIdle                900
TimeoutLogin                900
TimeoutNoTransfer        300
#TimeoutStalled                1500
TimeoutSession                1440
IdentLookups off
AllowFilter ^[-A-Za-z0-9_.(),/]*$
DenyFilter \*.*/
AllowForeignAddress off
AllowOverride off
UseReverseDNS off
RequireValidShell off
RootLogin off

# Port 21 is the standard FTP port.
Port                                21

# Use IPv6 support by default.
#UseIPv6                                on

# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask                                022

# To prevent DoS attacks, set the maximum number of child processes
# to 30.  If you need to allow more than 30 concurrent connections
# at once, simply increase this value.  Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd).
MaxInstances                        30

CommandBufferSize        512

# Set the user and group under which the server will run.
User                                ftp
Group                                ftp

# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.
#DefaultRoot /usr/data/pub

DefaultRoot ~
PersistentPasswd off

# Normally, we want files to be overwriteable.
AllowOverwrite                on

# Bar use of SITE CHMOD by default
<Limit SITE_CHMOD>
  DenyAll
</Limit>

# Logs
LogFormat default "%h %l %u %t "%r" %s %b"
TransferLog /var/log/proftpd/proftpd_transferlog
ServerLog /var/log/proftpd/proftpd_serverlog
SystemLog /var/log/proftpd/proftpd_systemlog

Include /usr/local/etc/proftpd_sql.conf

# Directory permissions

<directory /usr/data/pub>
    <limit WRITE>
        DenyAll
    </limit>
</directory>

#########################################################################
#                                                                      #
# Uncomment lines with only one # to allow basic anonymous access      #
#                                                                      #
#########################################################################

#<Anonymous ~ftp>
#  User                                ftp
 # Group                                ftpgroup
 
  ### We want clients to be able to login with "anonymous" as well as "ftp"
  # UserAlias                        anonymous ftp

  ### Limit the maximum number of anonymous logins
  #MaxClients                        1

  ### We want 'welcome.msg' displayed at login, and '.message' displayed
  ### in each newly chdired directory.
  #DisplayLogin                        welcome.msg
  #DisplayFirstChdir                .message
#AnonRequirePassword on
  ### Limit WRITE everywhere in the anonymous chroot
 #  <Limit WRITE>
#    DenyAll
 #  </Limit>
#</Anonymous>

И proftpd_sql.conf

Код:

#This ic config file for mysql engine
LoadModule mod_sql.c
LoadModule mod_sql_mysql.c
SQLBackend mysql
SQLEngine off
SQLAuthTypes                Crypt
SQLAuthenticate                users
SQLConnectInfo                ftp@localhost:3306 ftp mypassword
SQLUserInfo                users username password uid gid homedir shell
RequireValidShell off

SQLLogFile /var/log/proftpd/proftpd_sql.log

SQLLog                PASS                counter_login
SQLNamedQuery        counter_login        UPDATE "`last_login`=UNIX_TIMESTAMP(), `login_count`=`login_count`+1 WHERE `username`='%u'" `users_table`

SQLLog                ERR_PASS        counter_err
SQLNamedQuery        counter_err        UPDATE "`last_err_login`=UNIX_TIMESTAMP(), `err_login_count`=`err_login_count`+1 WHERE `username`='%U'" `users_table`

SQLLog                RETR,STOR                log_story_transfer
SQLNamedQuery        log_story_transfer        INSERT "'', UNIX_TIMESTAMP(),'%u','%f', '%b', '%h', '%a', '%m', '%t'" `xfer_table`

SQLLog                ERR_RETR,ERR_STOR,ERR_DELE,ERR_RMD,ERR_RNTO        log_error_modify
SQLNamedQuery        log_err_modify                INSERT "'', UNIX_TIMESTAMP(), '%u', '%f', '%h', '%a', '%m'" `xfer_errors`

Что касается запросов, я использую логирование в MySQL

Призрак 26-09-2012 14:25 1995111

Вложений: 1
SQLEngine поставил в On и перезапустил все равно ничего не получается. Будь проклят этот ProFTPd.

Кстати, для создания таблицы users_table я использовал такой запрос

Код:

DROP TABLE IF EXISTS `users_table`;
CREATE TABLE `users_table` (
  `unic_id` int(11) NOT NULL auto_increment,
  `username` varchar(20) NOT NULL,
  `password` varchar(20) NOT NULL,
  `groupname` varchar(24) NOT NULL,
  `uid` int(11) NOT NULL,
  `gid` int(11) NOT NULL,
  `homedir` varchar(50) NOT NULL,
  `shell` varchar(20) NOT NULL,
  `last_login` int(15) NOT NULL,
  `login_count` int(15) NOT NULL,
  `last_err_login` int(15) NOT NULL,
  `err_login_count` int(15) NOT NULL,
  PRIMARY KEY  (`unic_id`)
) ENGINE=MyISAM COMMENT='Таблица пользователей';

Когда я включил SQLEngine то счетчик как раз начал отсчитывать неверные логины, как указано на снимке экрана. Но нормально ни как не логинится в систему.


Время: 19:09.

Время: 19:09.
© OSzone.net 2001-