- 论坛徽章:
- 0
|
求救:希望各位大虾能帮帮我,新手刚刚学习LINUX系统管理,呵呵
我是用Mysql+Proftpd搭建的FTP
用Mysql里的test用户登录proftpd,发现不能登陆:
提示信息如下
530 login incorrect:
Connection closed by remote host:
试了很多方法都不行,网上有些解释说权限问题,有些则是配置文件配置问题,但试了都没用,希望各位帮帮忙,帮我看下,谢谢了
在mysql里建了ftpgroup和ftpuser表, 用户组是ftpgroup 权限是5500 下面的用户ftpuser 权限也是 5500
FTP的文件夹 是/home
/home权限
[root@localhost root]# ls -la /home
total 48
drw-r--r-- 12 5500 5500 4096 Aug 2 23:36 .
drwxr-xr-x 22 root root 4096 Jul 26 05:20 ..
drwxr-xr-x 2 5500 5500 4096 Aug 2 23:36 test
FTP系统日志如下
[root@localhost root]# tail -f /var/log/proftpd.system.log
Aug 02 17:55:56 localhost.localdomain proftpd[21374] localhost.localdomain (211.155.205.119[211.155.205.119]): error: unable to set default root directory
Aug 02 17:55:56 localhost.localdomain proftpd[21374] localhost.localdomain (211.155.205.119[211.155.205.119]): FTP session closed.
Aug 03 01:57:56 localhost.localdomain proftpd[21376] localhost.localdomain (211.155.205.119[211.155.205.119]): FTP session opened.
Aug 03 01:57:56 localhost.localdomain proftpd[21376] localhost.localdomain (211.155.205.119[211.155.205.119]): mod_delay/0.5: delaying for 20 usecs
Aug 03 01:57:56 localhost.localdomain proftpd[21376] localhost.localdomain (211.155.205.119[211.155.205.119]): USER test: Login successful.
Aug 03 01:57:56 localhost.localdomain proftpd[21376] localhost.localdomain (211.155.205.119[211.155.205.119]): notice: unable to use '~/' [resolved to '/home/test/']: Permission denied
Aug 02 17:57:56 localhost.localdomain proftpd[21376] localhost.localdomain (211.155.205.119[211.155.205.119]): Preparing to chroot to directory '~/'
Aug 02 17:57:56 localhost.localdomain proftpd[21376] localhost.localdomain (211.155.205.119[211.155.205.119]): test chroot("~/"): No such file or directory
Aug 02 17:57:56 localhost.localdomain proftpd[21376] localhost.localdomain (211.155.205.119[211.155.205.119]): error: unable to set default root directory
Aug 02 17:57:56 localhost.localdomain proftpd[21376] localhost.localdomain (211.155.205.119[211.155.205.119]): FTP session closed.
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"
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
# Set the user and group under which the server will run.
User ftpuser
Group ftpgroup
# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.
#DefaultRoot ~
# Normally, we want files to be overwriteable.
AllowOverwrite on
# ......
MaxClients 100
# ........
DisplayLogin welcome.msg
DisplayFirstChdir .message
# ....MSG
DisplayConnect /usr/local/proftpd/etc/connect.msg
DisplayGoAway /usr/local/proftpd/etc/goway.msg
# ..quit....MSG
DisplayQuit /usr/local/proftpd/etc/quit.msg
MaxHostsPerUser 1
MaxClientsPerUser 2
# ...,..IP.......
MaxClientsPerHost 1
RootLogin off
RequireValidShell off
UseReverseDNS off
IdentLookups off
TimeoutStalled 600
TimeoutLogin 900
TimeoutIdle 600
TimeoutNoTransfer 600
# .proftp.......FXP............
AllowForeignAddress on
# .........
ServerIdent off
# ..ftpuser..........
DefaultRoot ~ ftpgroup
#-------- load sql.mod for mysql authoritative --------#
# Backend.........MySQL........
# Plaintext.......................
SQLAuthTypes Backend Plaintext
# ......
SQLAuthenticate users* groups*
# ........
# ftpdb.....,localhost....
# proftpd..........,password...
#..........
SQLConnectInfo ftpdb@localhost proftpd password
# ................
SQLUserInfo ftpuser userid passwd uid gid homedir shell
SQLGroupInfo ftpgroup groupname gid members
# ............................homedir..........
SQLHomedirOnDemand on
SQLNegativeCache on
# Update count every time user logs in
SQLLogFile /var/log/proftpd.sql.log
SQLNamedQuery getcount SELECT "count from ftpuser where userid='%u'"
SQLNamedQuery getlastlogin SELECT "lastlogin from ftpuser where userid='%u'"
SQLNamedQuery updatelogininfo UPDATE "count=count+1,host='%h',lastlogin=current_timestamp() WHERE userid='%u'" ftpuser
SQLShowInfo PASS "230" "You've logged on %{getcount} times, last login at %{getlastlogin}"
SQLLog PASS updatelogininfo
#-------- load sql.mod for mysql authoritative --------#
#-------- load qudes.mod for Quota limit --------#
#........
QuotaEngine on
# ......
QuotaDirectoryTally on
# ............
QuotaDisplayUnits Mb
# ...........ftp......quote site quota............
QuotaShowQuotas on
# ..........
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
#--------- load qudes.mod for Quota limit --------#
# emerg, alert, crit (empfohlen), error, warn. notice, info, debug
#
SyslogLevel emerg
SystemLog /var/log/proftpd.system.log
TransferLog /var/log/proftpd.xferlog
# Some logging formats
#
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"
# Log file/dir access
# ExtendedLog /var/log/proftpd.access_log WRITE,READ write
# Record all logins
ExtendedLog /var/log/proftpd.auth_log AUTH auth
# Paranoia logging level....
ExtendedLog /var/log/proftpd.paranoid_log ALL default
# Bar use of SITE CHMOD by default
<Limit SITE_CHMOD>
DenyAll
</Limit>
# A basic anonymous configuration, no upload directories. If you do not
# want anonymous users, simply delete this entire <Anonymous> section.
<Anonymous ~ftp>
# User ftp
# Group ftp
# 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 10
# We want 'welcome.msg' displayed at login, and '.message' displayed
# in each newly chdired directory.
DisplayLogin welcome.msg
DisplayFirstChdir .message
# Limit WRITE everywhere in the anonymous chroot
<Limit WRITE>
DenyAll
</Limit>
</Anonymous> |
|