我在 gitlab ci Runner中连接到sftp连接时遇到问题。
lftp -d -e "set sftp:auto-confirm yes; mirror -Rv $local_dir $remote_dir" -u $USERNAME,$PASSWORD sftp://$HOST -p 22
gitlab 会在gitlab ci中引发连接超时
$ sh ./scripts/deploy.sh
---- Running connect program (ssh -a -x -s -l username -p 22 myip sftp)
---> sending a packet, length=5, type=1(INIT), id=0
**** Timeout - reconnecting
---- Disconnecting
---- Running connect program (ssh -a -x -s -l username -p 22 myip sftp)
---> sending a packet, length=5, type=1(INIT), id=0
**** Timeout - reconnecting
---- Disconnecting
ls: Fatal error: max-retries exceeded
但是在本地运行正常,此问题仅在 gitlab ci
中出现