通过iptables防火墙允许curlftpfs,怎么样?

我允许FTP端口21和20,然后允许我通过“ftp”命令连接到我的FTP服务器,但我仍然无法使curlftpfs工作。

curlftpfs都使用哪些端口? 还是他们的其他东西,我必须做iptables允许curlftpfs?

curlftpfs -v 10.10.10.1 /ftp1/ -o user=user:pass 

当我尝试在/ ftp1 / http://drp.ly/13573T中执行“ls -l”时,我在日志中得到这个

我把日志上传到了那个网站,因为这里看起来很乱

我使用这些规则来允许FTP:

 iptables -A INPUT -p tcp --sport 21 -j ACCEPT iptables -A INPUT -p tcp --sport 20 -j ACCEPT 

它看起来像curlftpfs使用pasv模式。 您需要强制激活模式,或modprobe ip_conntrack_ftp允许通过pasv连接。

强制激活模式:

curlftpfs -oftp_port=- myserver.example.com /mnt/my_ftpfs_mountpoint

确保您的防火墙也接受端口20上的传入和传出stream量。端口21只是传出。

如果支持没有被编译到内核中, ip_nat_ftp内核模块需要被加载。

尝试:

/sbin/modprobe ip_nat_ftp