저는 주로 포트 2222에서 SFTP를 사용하고 포트 21에서 FTP를 사용하는 2개의 FTP 서버를 가지고 있습니다. ProFTPd 시스템에서 proftpd_admin 도구를 실행합니다: proftpd-admin 링크1
사용자를 위해 MySQL 백엔드를 사용합니다. 그러나 포트 2222의 SFTP는 이 사용자 데이터베이스를 사용하지만 FTP 부분은 로컬 시스템 계정을 사용하여 서버에 액세스하는 것으로 나타났습니다.
동일한 MySQL 데이터베이스를 사용하여 두 서비스를 모두 제공하고 싶습니다. proftpd.conf의 전역 섹션에 SQL 섹션을 추가하고 sftp 서비스를 정의했습니다.
가상 서버에서 FTP 서비스를 정의했지만 로드 모듈 mysql을 추가하면 일반적으로 시작되지 않습니다.
가상 서버에서 ftp 서비스에 대한 mysql 사용을 어디서 어떻게 정의할 수 있는지에 대한 제안 사항이 있습니까?
감사해요.
[편집] PS 이것은 내 proftpd.conf입니다.
ServerName "Some FTP Delivery server"
ServerIdent on "FTP Server ready."
ServerAdmin root@localhost
DefaultServer on
DefaultAddress 372.124.444.395
DefaultRoot ~ !adm
TimeoutIdle 300
TimeoutNoTransfer 600
UseIPv6 off
#AuthPAMConfig proftpd
UseReverseDNS off
User nobody
Group nobody
MaxInstances 100
RequireValidShell off
AllowForeignAddress on
AllowRetrieveRestart on
AllowStoreRestart on
UseSendfile off
Umask 000 000
PassivePorts 65100 65199
LogFormat default "%h %l %u %t \"%r\" %s %b"
LogFormat auth "%v [%P] %h %t \"%r\" %s"
LogFormat write "%h %l %u %t \"%r\" %s %b"
TransferLog /var/log/proftpd/xfer.log
ExtendedLog /var/log/proftpd/auth.log AUTH auth
AuthOrder mod_sql.c
# Modules to load section.
LoadModule mod_ctrls_admin.c
LoadModule mod_vroot.c
LoadModule mod_sftp.c
#LoadModule mod_sftp_sql.c
LoadModule mod_sql.c
LoadModule mod_sql_mysql.c
LoadModule mod_quotatab.c
LoadModule mod_quotatab_sql.c
LoadModule mod_wrap.c
LoadModule mod_rewrite.c
LoadModule mod_shaper.c
LoadModule mod_ifsession.c
ModuleControlsACLs insmod,rmmod allow user root
ModuleControlsACLs lsmod allow user *
ControlsEngine on
ControlsACLs all allow user root
ControlsSocketACL allow user *
ControlsLog /var/log/proftpd/controls.log
<IfModule mod_ctrls_admin.c>
AdminControlsEngine on
AdminControlsACLs all allow user root
</IfModule>
<IfModule mod_vroot.c>
VRootEngine on
</IfModule>
<IfDefine TLS>
TLSEngine on
TLSRequired on
TLSRSACertificateFile /etc/pki/tls/certs/proftpd.pem
TLSRSACertificateKeyFile /etc/pki/tls/certs/proftpd.pem
TLSCipherSuite ALL:!ADH:!DES
TLSOptions NoCertRequest
TLSVerifyClient off
TLSLog /var/log/proftpd/tls.log
<IfModule mod_tls_shmcache.c>
TLSSessionCache shm:/file=/var/run/proftpd/sesscache
</IfModule>
</IfDefine>
/etc/sysconfig/proftpd
<IfDefine DYNAMIC_BAN_LISTS>
LoadModule mod_ban.c
BanEngine on
BanLog /var/log/proftpd/ban.log
BanTable /var/run/proftpd/ban.tab
BanOnEvent MaxLoginAttempts 2/00:10:00 01:00:00
BanMessage "Host %a has been banned"
BanControlsACLs all allow user ftpadm
</IfDefine>
# Set networking-specific "Quality of Service" (QoS) bits on the
packets used
# by the server (contrib/mod_qos.html)
<IfDefine QOS>
LoadModule mod_qos.c
# RFC791 TOS parameter compatibility
QoSOptions dataqos throughput ctrlqos lowdelay
# For a DSCP environment (may require tweaking)
#QoSOptions dataqos CS2 ctrlqos AF41
</IfDefine>
<Global>
AllowOverwrite yes
<Limit ALL SITE_CHMOD>
AllowAll
#DenyAll
</Limit>
ShowSymlinks on
<IfModule mod_sql.c>
SQLBackend mysql
SQLAuthTypes Backend
SQLConnectInfo [email protected] proftpd proftpd
SQLUserInfo usertable userid passwd uid gid
homedir shell
SQLGroupInfo grouptable groupname gid members
SQLUserWhereClause "disabled=0 and (NOW()<=expiration
or expiration=-1 or expiration=0)"
SQLLog PASS counter
SQLNamedQuery counter UPDATE "lastlogin=now(), count=count+1 WHERE
userid='%u'" usertable
SQLLog EXIT time_logout
SQLNamedQuery time_logout UPDATE "lastlogout=now() WHERE
userid='%u'" usertable
SQLNamedQuery login_time SELECT "lastlogin from usertable where
userid='%u'"
#SQLShowInfo PASS "230" "Last login was: %{login_time}"
SQLLog RETR,STOR transfer1
SQLNamedQuery transfer1 INSERT "'%u', '%f', '%b', '%h', '%a',
'%m', '%T', now(), 'c', NULL" xfer_stat
SQLLog ERR_RETR,ERR_STOR transfer2
SQLNamedQuery transfer2 INSERT "'%u', '%f', '%b', '%h', '%a',
'%m', '%T', now(), 'i', NULL" xfer_stat
</IfModule>
<IfModule mod_quotatab.c>
QuotaEngine on
QuotaDirectoryTally on
QuotaDisplayUnits Mb
QuotaShowQuotas on
QuotaOptions ScanOnLogin
QuotaLog /var/log/proftpd/quota.log
SQLNamedQuery get-quota-limit SELECT "name, quota_type,
per_session, limit_type, bytes_in_avail, bytes_out_avail,
bytes_xfer_avail, files_in_avail, files_out_avail, files_xfer_avail
FROM ftpquotalimits WHERE name = '%{0}' AND quota_type = '%{1}'"
SQLNamedQuery get-quota-tally SELECT "name, quota_type,
bytes_in_used, bytes_out_used, bytes_xfer_used, files_in_used,
files_out_used, files_xfer_used FROM ftpquotatallies WHERE name = '%
{0}' AND quota_type = '%{1}'"
SQLNamedQuery update-quota-tally UPDATE "bytes_in_used =
bytes_in_used + %{0}, bytes_out_used = bytes_out_used + %{1},
bytes_xfer_used = bytes_xfer_used + %{2}, files_in_used =
files_in_used + %{3}, files_out_used = files_out_used + %{4},
files_xfer_used = files_xfer_used + %{5} WHERE name = '%{6}' AND
quota_type = '%{7}'" ftpquotatallies
SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %
{4}, %{5}, %{6}, %{7}" ftpquotatallies
QuotaLimitTable sql:/get-quota-limit
QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-
quota-tally
</IfModule>
</Global>
<IfModule mod_sftp.c>
SFTPEngine on
Port 2222
SFTPLog /var/log/proftpd/sftp.log
SFTPAuthMethods password #publickey
SFTPHostKey /etc/ssh/ssh_host_dsa_key
SFTPHostKey /etc/ssh/ssh_host_rsa_key
</IfModule>
#<VirtualHost 172.23.54.195>
# port 21
# DefaultRoot ~ !admins
# MaxClientsPerHost 25 "Sorry, no more!"
# MaxClients 50 "Sorry, too much users.."
#</VirtualHost>
Include /etc/proftpd/classes.conf
Include /etc/proftpd/groups.conf
Include /etc/proftpd/shaper.conf
Include /etc/proftpd/limits.conf
Include /etc/proftpd/virtuals.conf