【发布时间】:2026-02-20 11:15:01
【问题描述】:
我有一个在 Linux 上运行的 FTP 脚本,但它失败了。这是脚本:
/usr/bin/ftp -v -i -n my.ftp.server << cmd
user ftpuser password
binary
ls
<some other commands here>
quit cmd
它返回一个错误:
421 Service not available, remote server has closed connection
Not connected.
这里奇怪的是,如果我只是在命令行中输入: /usr/bin/ftp my.ftp.server 它要求输入用户名和密码,在我提供它们之后,我就可以连接了!
在 ftp 中,我输入 ls,我可以看到来自 FTP 服务器的文件。 我的脚本有什么问题?
而且,我没有对 FTP 服务器的 putty 访问权限,所以我看不到那里的日志。有什么想法吗?
谢谢!
【问题讨论】: