歡迎您光臨本站 註冊首頁

proftp真的很愛出問題!最典型的421錯誤!

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

proftp真的很愛出問題!最典型的421錯誤!

proftp真的很愛出問題!最典型的421錯誤!
我新架一台proftp伺服器,系統是bsd6.2 通過ports安裝,make config選擇好sql 已經限額模塊
現在裝好了,版本是
sk# pkg_info |grep proftp
proftpd-1.3.1.r2_3  Highly configurable ftp daemon
sk#
現在我將另外一台伺服器的proftpd.conf 粘貼過來

# 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                        "ProFTPD Default Installation"
ServerName                        "sk's ftp"
ServerType                        standalone
DefaultServer                        on

# Port 21 is the standard FTP port.
Port                                21

# 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
MaxLoginAttempts                 3

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


# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.
#DefaultRoot ~
DefaultRoot ~  
#put the proftpd log files in /var/log/ftp.syslog
#SystemLog /var/log/ftp.syslog
SystemLog /var/log/ftp.syslog

#TransferLog log files
#TransferLog /var/log/ftp.transferlog

MaxHostsPerUser 5 "Sorry, you may not connect more than one time 1."
MaxClientsPerUser 13 "Only one such user at a time 2."
MaxClientsPerHost 20 "Sorry, you may not connect more than one time 3."

#setup the Restart
AllowRetrieveRestart on
UseReverseDNS off                                    
IdentLookups off
PassivePorts 5555 6666
RootLogin off
RequireValidShell off
TimeoutStalled 600
MaxClients 20
AllowForeignAddress on
AllowStoreRestart on
ServerIdent off
DefaultRoot ~ ftpgroup

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

TimeoutIdle 600

SQLAuthTypes Backend Plaintext

SQLAuthenticate users* groups*

# databasename@host database_user user_password
#SQLConnectInfo ftpdb@localhost proftpd password
SQLConnectInfo proftp@localhost proftp proftp

SQLUserInfo ftpuser userid passwd uid gid homedir shell
SQLGroupInfo ftpgroup groupname gid members
SQLHomedirOnDemand on

# Update count every time user logs in
SQLLog PASS updatecount
SQLNamedQuery updatecount UPDATE "count=count+1,accessed=now() WHERE userid='%u'" ftpuser
# Update modified everytime user uploads or deletes a file
SQLLog STOR,DELE modified
SQLNamedQuery modified UPDATE "modified=now() WHERE userid='%u'" ftpuser

QuotaEngine on
QuotaDirectoryTally on
QuotaDisplayUnits kb
QuotaShowQuotas on
QuotaLog "/var/log/quota"

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


<Directory /home/user>
<Limit WRITE>
</Limit>
</Directory>
資料庫也是另外一台生產伺服器的結構,現在也將vipw中的ftpuser 和group 的數據添加到了新伺服器.然後
#echo "proftpd_enable="yes" > /etc/rc.conf"
#sh /etc/rc
現在#netstat -an|grep 21可以看到ftp已經啟動了,但是:
sk# ftp 127.0.0.1
Connected to 127.0.0.1.
421 Service not available, remote server has closed connection.
ftp>

ipfw list
65535 allow ip from any to any

不知道這是啥原因,根據個人經驗覺得是mysql沒有連接上,但是我用proftp 的用戶又能登陸!分析了裡面的數據結構也是對的.真的找不到原因了!希望有高手幫忙!

#more /var/log/ftp.syslog
Apr 25 01:20:57 sk.com proftpd sk.com (127.0.0.1): ProFTPD terminating (signal 11)
Apr 25 01:20:57 sk.com proftpd sk.com (127.0.0.1): FTP session closed.
#more proftpd.system.log
Apr 24 21:26:30 sk.com proftpd sk.com (localhost.com): ProFTPD terminating (signal 11)
Apr 24 21:26:30 sk.com proftpd sk.com (localhost.com): FTP session closed.
Apr 24 23:16:25 sk.com proftpd sk.com: ProFTPD killed (signal 15)
Apr 24 23:16:25 sk.com proftpd sk.com: ProFTPD 1.3.1rc2 standalone mode SHUTDOWN
Apr 24 23:16:31 sk.com proftpd sk.com: ProFTPD 1.3.1rc2 (devel) (built Tue Apr 24 01:30:34 CST 2007) standalone mode S
TARTUP


[ 本帖最後由 zhengwei_zw 於 2007-4-24 17:23 編輯 ]
《解決方案》

我也遇到同樣問題,正在嘗試換mysql 4.1系列的資料庫試試,估計是高版本資料庫不太兼容
《解決方案》

我是MYSQL5,將配置文件的連接資料庫的用戶名使用root的,就可以正常登陸了!

[火星人 ] proftp真的很愛出問題!最典型的421錯誤!已經有1056次圍觀

http://coctec.com/docs/service/show-post-36714.html