免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 3922 | 回复: 16
打印 上一主题 下一主题

[FTP] Proftp不能登陆 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-08-03 02:38 |只看该作者 |倒序浏览
求救:希望各位大虾能帮帮我,新手刚刚学习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>

论坛徽章:
0
2 [报告]
发表于 2008-08-03 02:59 |只看该作者
CU里面用全站搜索一下530+proftp,太多了。

论坛徽章:
0
3 [报告]
发表于 2008-08-03 21:15 |只看该作者
在CU里查了,只有2个问的,都没有解决的方法啊,哎

各位大哥帮帮忙啊

论坛徽章:
0
4 [报告]
发表于 2008-08-03 21:24 |只看该作者

论坛徽章:
0
5 [报告]
发表于 2008-08-03 21:52 |只看该作者
谢谢斑竹的帮忙哦  不过我的SELINUX是关闭的,应该不是SELINUX阻碍了

setsebool -P ftp_home_dir=1这条语句也无法执行

论坛徽章:
0
6 [报告]
发表于 2008-08-04 03:22 |只看该作者
原帖由 womenshizhutou 於 2008-8-3 21:52 發表
謝謝斑竹的幫忙哦  不過我的SELINUX是關閉的,應該不是SELINUX阻礙了
setsebool -P ftp_home_dir=1這條語句也無法執行


setsebool 出現錯誤訊息是?

--

论坛徽章:
0
7 [报告]
发表于 2008-08-04 12:14 |只看该作者
原帖由 kenduest 于 2008-8-4 03:22 发表


setsebool 出現錯誤訊息是?

--




-bash: setsebool: command not found

论坛徽章:
0
8 [报告]
发表于 2008-08-04 15:20 |只看该作者
原帖由 womenshizhutou 於 2008-8-4 12:14 發表
-bash: setsebool: command not found


這,這是命令找不到而不是沒啟用 selinux

執行如下命令把結果列出:


  1. cat /etc/sysconfig/selinux
  2. cat /selinux/enforce
复制代码


--

论坛徽章:
0
9 [报告]
发表于 2008-08-04 16:27 |只看该作者
原帖由 kenduest 于 2008-8-4 15:20 发表


這,這是命令找不到而不是沒啟用 selinux

執行如下命令把結果列出:


cat /etc/sysconfig/selinux
cat /selinux/enforce


--


[root@localhost root]# cat /etc/sysconfig/selinux
cat: /etc/sysconfig/selinux: No such file or directory

[root@localhost root]# cat /selinux/enforce
cat: /selinux/enforce: No such file or directory

论坛徽章:
0
10 [报告]
发表于 2008-08-04 16:28 |只看该作者
看起來應該不是 selinux 關係。只是你用那個發行版本 ?

--
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP