我正在尝试使用 ftp 命令行发送文件。它在我的笔记本电脑上运行正常,但在 vps 服务器上却不行。
ftp -v -n <<EOF
open ftp.myserver.com
user username password
cd /folder/
put file.csv
EOF
我在 proxmox 下使用虚拟机,运行:debian 8、webmin 和 csf 防火墙。不知道它是被客户服务器还是主机服务器阻止了。
这是该命令的输出:
Connected to ftp.myserver.com.
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 2 of 500 allowed.
220-Local time is now 16:57. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
331 User username OK. Password required
230-Your bandwidth usage is restricted
230-OK. Current restricted directory is /
230 1394 Kbytes used (0%) - authorized: 153600000 Kb
Remote system type is UNIX.
Using binary mode to transfer files.
250 OK. Current directory is /folder
local: file.csv remote: file.csv
200 PORT command successful
425 Could not open data connection to port 48412: Connection timed out
221-Goodbye. You uploaded 0 and downloaded 0 kbytes.
221 Logout.
答案1
我通过在主机服务器中运行此命令解决了我的问题
modprobe ip_conntrack_ftp
然后我将 ip_conntrack_ftp 添加到 /etc/modules 文件中(因此重启后它可以工作)