不能ftp localhost但可以从远程服务器ftp

时间:2015-02-04 06:42:38

标签: linux ftp

我已经将vsftp安装到服务器,状态现在正在运行,但是当使用命令ftp localhost时,它弹出421 Service not available.,会告诉我哪里出错了?感谢

bash-3.2# /etc/rc.d/init.d/vsftpd status
vsftpd (pid 580) is running...
bash-3.2# ps -ef |grep vsftpd
root 580 1 0 15:44 ? 00:00:00 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
root 607 467 0 15:45 pts/0 00:00:00 grep vsftpd
bash-3.2# ftp localhost
Connected to localhost (127.0.0.1).
421 Service not available.

以下是输出,会建议我该怎么办?感谢

bash-3.2# netstat -tanp |grep ftp

tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 3205/vsftpd
bash-3.2# ps -ef |grep ftp
root 3205 1 0 Feb02 ? 00:00:00 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
root 6075 5626 0 21:35 pts/0 00:00:00 grep ftp


bash-3.2# /sbin/iptables -nvL

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
bash-3.2# /sbin/chkconfig --list |grep ip
all iptables are off

2 个答案:

答案 0 :(得分:0)

bash-3.2# ftp localhost
Connected to localhost (127.0.0.1).
421 Service not available.

看起来你可以连接,也就是服务器监听这个地址(就像你用netstat看到的那样)并且没有阻止连接的iptables规则。

相反,服务器本身拒绝为您服务。因此,您需要查看服务器日志和服务器配置以获取帮助。也许您应该查看tcp_wrappers选项以及/etc/hosts.allow等中的相关配置。

答案 1 :(得分:0)

vsftpd.conf中有一个名为tcp_wrappers = YES的参数。它会检查/ etc下的hosts.deny文件。您可以更改tcp_wrappers = NO,也可以检查/ etc

下的hosts.deny文件
相关问题