ubuntu - lftp 卡在 "connecting"

标签 ubuntu ftp cloud9-ide lftp

我使用 lftp 将文件从 Cloud 9 IDE 传输到远程主机。最近,它似乎停止了工作。我已经向主人提出了这个问题,他们认为它工作正常。事实上,我可以通过 FileZilla 和一个简单的浏览器连接到 ftp 主机。我已经用 Cloud 9 提出了它,但也没有运气。

我正在从命令行使用以下命令传输文件:

lftp -e "debug; set ssl:verify-certificate no; put ./res/test.txt -o test.txt; bye" -u abcd,xyz ftp.example.com

(set ssl:verify-certificate no 是不久前添加的,以克服突然出现的类似连接问题……我也尝试过不使用它……结果相同)

我在 C9 中发现的是,它永远在尝试连接:
---- Connecting to ftp.example.com (xx.xxx.xx.xxx) port 21
**** Socket error (Connection timed out) - reconnecting
---- Closing control socket
---- Connecting to ftp.example.com (xx.xxx.xx.xxx) port 21
**** Socket error (Connection timed out) - reconnecting
---- Closing control socket
---- Connecting to ftp.example.com (xx.xxx.xx.xxx) port 21

可能很难提供任何帮助,但有没有人有任何想法至少可以帮助我诊断?还有其他选择吗?

谢谢。

最佳答案

在我的情况下,lftp 没有指示 ssh 明确使用“密码身份验证”,它一直在等待来自键盘的密码

<--- debug1: Authentications that can continue: keyboard-interactive,password
<--- debug1: Next authentication method: keyboard-interactive 
<--- Password authentication

将 sftp:connect-program 设置为 "ssh -oPreferredAuthentications=password -a -x" 后我摆脱了这个问题。
lftp << !
  set sftp:connect-program "ssh -oPreferredAuthentications=password -a -x"
  open -u $USER --env-password $PROTOCOL://$HOST
  mirror -vvv -c --only-missing -P 600 $SRC_FOLDER /dbfs/mnt/$HOST/$DST_FOLDER
!

如果您仍然有问题,那么您可以启用调试并通过传递 -v 来查看问题所在。至ssh-dopen
lftp << !
  set sftp:connect-program "ssh -a -x -v"
  open -d -u $USER --env-password $PROTOCOL://$HOST
  ls
!

关于ubuntu - lftp 卡在 "connecting",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38302978/

相关文章:

git - 如何将 Git 存储库分支与 FTP 同步?

java - FTP 至 1and1.com

cloud9-ide - Cloud 9 IDE 中是否有离线模式

git - 如何将更改直接从 Cloud9 IDE 推送到 Heroku?

python - 无法在 AWS Cloud9 IDE 中使用 Python 访问本地环境变量

opengl - 找不到lGL

linux - 如何在 Ubuntu 中使用键盘键在两个相同窗口之间切换

java - 12.10 无法安装 eclipse

apache - 为什么页面没有完全加载?

python - 使用正则表达式从 FTP 服务器下载文件