您的位置:首页 > 运维架构 > Linux

linux vsftp“ftp: connect: No route to host” and "connect: Connection refused"

2017-07-16 01:03 651 查看
Linux FTP文件服务器的问题:

ftp: connect: No route to host” 和ftp: connect: Connection refused可能是因为FTP服务器没有开默认的21端口,导致其他机器连接被拒。

1 检查我的vsftp有没有启动。来的土的方法: 

#/usr/sbin/vsftpd 

500 OOPS: vsftpd: not configured for standalone, must be started from inetd 

2 看来问题出在这里,检查一下: 没有开FTP默认的21端口

#netstat -na --ip 

发现port 21根本没有打开 

[root@localhost102 ftptest]# vi /etc/sysconfig/iptables

-A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT

[root@localhost102 ftptest]#  /etc/init.d/iptables restart

iptables: Applying firewall rules:                         [  OK  ]

[root@localhost102 ftptest]# service vsftpd start 

Starting vsftpd for vsftpd:                                [  OK  ]

[root@localhost102 ftptest]# netstat -na --ip

Active Internet connections (servers and established)

Proto Recv-Q Send-Q Local Address               Foreign Address             State      

tcp        0      0 0.0.0.0:21                  0.0.0.0:*                   LISTEN      

tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN   

3 先测试一下: 

#ftp 127.0.0.1 

正常了!



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: