Linux 无法ftp本地主机,但可以从远程服务器ftp

Linux 无法ftp本地主机,但可以从远程服务器ftp,linux,ftp,Linux,Ftp,我已将vsftp安装到服务器上,状态现在正在运行,但是当使用命令ftp localhost时,它会弹出421服务不可用。,会提示出什么问题吗?谢谢 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 roo

我已将vsftp安装到服务器上,状态现在正在运行,但是当使用命令
ftp localhost
时,它会弹出
421服务不可用。
,会提示出什么问题吗?谢谢

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
看起来您可以连接,即服务器侦听此地址(就像您在netstat中看到的那样),并且没有阻止连接的iptables规则


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

在vsftpd.conf中有一个名为tcp_wrappers=YES的参数。它会检查/etc下的hosts.deny文件。您可以更改tcp_wrappers=NO,也可以检查/etc下的hosts.deny文件,尝试
ftp
本地计算机的FQDN,例如
ftp your.local.machine.yourdomain.com
;在不太可能的情况下,您确实希望
ftp localhost
(但是为什么呢?)设置
vsftpd
,以便同时侦听
localhost
和FQDN
bash-3.2# ftp localhost
Connected to localhost (127.0.0.1).
421 Service not available.