2

I use lftp to transfer files from my Cloud 9 IDE to a remote host. Recently, it seems to have stopped working. I've raised this with the host, and they think it's working OK. Indeed, I can connect to the ftp host via FileZilla, and via a simple browser. I've raised it with Cloud 9, but no luck either.

I'm transferring a file using the following from the command line:

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

(the set ssl:verify-certificate no was an addition from a while ago, to overcome a similar connection problem that suddenly appeared... I've tried without it too... same result)

What I'm finding in C9 is that is forever trying connect, with:

---- 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

Difficult to offer any assistance, probably, but does anyone have any ideas at least to help me diagnose? Any additional options to try?

Thanks.

drmrbrewer
  • 11,491
  • 21
  • 85
  • 181
  • This message means a connectivity problem, routing or firewall not passing the packets. – lav Jul 14 '16 at 09:00
  • So you think this is likely to be an issue at the Cloud 9 end rather than the ftp host end? Some sort of firewall set up around the IDE? – drmrbrewer Jul 14 '16 at 09:26
  • It can be on the client host and in between. Unlikely on the server side if other clients can connect. – lav Jul 14 '16 at 09:40

3 Answers3

6

In my case lftp doesn't instruct ssh to use "password authentication" explicitly and it stuck waiting for a password from a keyboard

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

after setting sftp:connect-program to "ssh -oPreferredAuthentications=password -a -x" I got rid of the issue.

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
!

if you still have the issue then you can enable debug and see what is going wrong by passing -v to ssh and -d to open

lftp << !
  set sftp:connect-program "ssh -a -x -v"
  open -d -u $USER --env-password $PROTOCOL://$HOST
  ls
!
Anton
  • 1,432
  • 13
  • 17
1

I had this problem after upgrading Ubuntu to 16.04 to make use of TLS 1.2. The first command issued, whether a cd or an ls would result in [Connecting...] which would hang.

It turned out that their Comcast Router had a port forwarding rule for incoming tcp port 21 (21 is ftp) to a holter monitor server. I disabled that rule and the problem went away instantly.

alexxmed
  • 81
  • 1
1

This can also be caused by mismatches or permissions issues in ~/.ssh/known_hosts and ~./ssh/authorized_keys.

After correcting the conflict with the port forwarding rule in the router, this happened again for one of the users. I fixed it by copying my (working) ~/.ssh/authorized_keys and ~/.ssh/known_hosts over hers and setting the permissions.

Ralf
  • 16,086
  • 4
  • 44
  • 68
alexxmed
  • 81
  • 1