当通过终端连接到ftp时,一切都很好。
当使用lftp时,我经常被超时,永远无法同步文件夹内容。但是为什么呢?
script.sh:
lftp -c "
debug
open $HOST
user $USER $PASS
lcd $FSOURCE
mirror --delete --verbose $FSOURCE $FTARGET
exit
"结果:登录是成功的,但得到一个关于不正确的PASV模式的信息,然后什么都不会发生。
...
<--- 230 User logged in
---> PWD
<--- 257 "/" is the current directory
---> PBSZ 0
<--- 200 PBSZ 0 successful
---> PROT P
<--- 200 Protection set to Private
---> PASV
<--- 227 Entering Passive Mode (...).
---- Address returned by PASV seemed to be incorrect and has been fixed
---- Connecting data socket to (...) port 65242我还尝试了set ftp:passive-mode false强制活动模式。结果:
---> PORT ...
<--- 500 Illegal PORT command
---- Switching passive mode on
---> LIST
---> ABOR
---- Closing aborted data socket
---- Closing control socket发布于 2018-03-05 11:40:23
结果表明,通过终端的正常ftp命令仍然成功。我可以修复防止使用ssl的lftp。可能是ftp所有者突然禁用了它。
set ftp:ssl-allow off;
https://unix.stackexchange.com/questions/428221
复制相似问题