解决vsftpd 2.2.2读取目录列表失败的问题

本文介绍了一个由iptables配置引发的FTP连接问题及其解决方案。通过修改iptables的配置文件,并加载特定的nat模块来解决重启服务器后的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

该错误是由iptables的配置引起的,临时的解决方法是执行如下命令:

[root@localhost soft]# modprobe ip_nat_ftp

再次登陆列表正常啦!

但当你重新启动服务器则iptables规则失效,又会出现相同的情况,所以我们需要修改/etc/sysconfig/iptables-config文件,

[root@localhost soft]# vi /etc/sysconfig/iptables-config

# Load additional iptables modules (nat helpers)
#   Default: -none-
# Space separated list of nat helpers (e.g. 'ip_nat_ftp ip_nat_irc'), which
# are loaded after the firewall rules are applied. Options for the helpers are
# stored in /etc/modprobe.conf.
IPTABLES_MODULES=""

# Unload modules on restart and stop
#   Value: yes|no,  default: yes
# This option has to be 'yes' to get to a sane state for a firewall
# restart or stop. Only set to 'no' if there are problems unloading netfilter
# modules.
IPTABLES_MODULES_UNLOAD="yes"

......

IPTABLES_MODULES_UNLOAD="yes"的意义:每次iptables停止或者重启都会Unload modules

IPTABLES_MODULES=""的意义:每次防火墙规则应用以后加载的模块

我们需要把

IPTABLES_MODULES=""

修改为:

IPTABLES_MODULES="ip_nat_ftp"

这样重启服务器之后就不必再每次都执行mobprobe啦。

转载于:https://www.cnblogs.com/macil/p/3968928.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值