在Debian上设置vsftpd端口转发,通常需要使用iptables工具
sudo apt-get update
sudo apt-get install vsftpd
sudo systemctl start vsftpd
sudo apt-get install iptables
<外部端口>
和<内部IP>
:sudo iptables -t nat -A PREROUTING -p tcp --dport <外部端口> -j DNAT --to-destination <内部IP>:21
sudo apt-get install iptables-persistent
在安装过程中,选择“是”以保存当前规则。
sudo systemctl restart vsftpd
现在,您应该能够通过外部端口2121访问vsftpd服务。请确保您的防火墙允许传入连接到外部端口2121。