I'm trying to use LFTP (v 4.8.3) to connect to my KVM. This server already allows me to remote execute SSH through terminal and SFTP through FTP client (Transmit app).

I want to do this in order to do CI/CD using GitLab, but LFTP doesn't work in my local machine (macOS Sierra 10.12.6), so neither does in the CI/CD pipeline.

This is what I do:

lftp -d -c "set ftp:ssl-allow true; set ftp:use-feat false; open -u my_user,my_pass -p 22 my_ip; mirror -Rnv /Applications/XAMPP/xamppfiles/htdocs/my-website /var/www/html --ignore-time --parallel=10 --exclude-glob .git* --exclude .git/"

And this is what LFTP returns:

---- Resolving host address... ---- 1 address found: my_ip ---- Connecting to my_ip (my_ip) port 22 <--- SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.4 mkdir `/var/www/html' [TLS negotiation...]

It hangs like that for a couple minutes and then it returns this:

[same lines as ^ before] **** Peer closed connection <––––––––––––––– ---- Resolving host address... [etc]

And that's it. Seems like it can hang out in that "connect–TLS negotiation–disconnect" loop for ever.

UFW doesn't block the SSH connection, and I don't see any error in the log file. I tried opening SSH port to anyone, but still not success. I tried rsync but is not useful because it asks me for the SSH user's password and I can't set that using GitLab's .gitlab-ci.yml configuration file.

I don't know what else I can do. I want to use LFTP but I'm open to other options like cURL or Wget.

  • 1
    you're doing a confusion between the ftp protocol (with or without ssl) and the sftp protocol. try lftp sftp://user@host/
    – A.B
    May 17 '18 at 17:42
  • Yeah, I tried that, but still not useful because that asks for a password and I cannot set it from the GitLab's .gitlab-ci.yml configuration file. May 17 '18 at 20:57
  • 1
    you should think a bit more on "ftp" versus "sftp" and what I really meant to convey
    – A.B
    May 17 '18 at 21:41

In you current command, lftp is not using sftp, which would be FTP over the SSH protocol, but ftps which is FTP over SSL.

For lftp to work as an sftp client, you would need to add sftp:// to the host you are connecting to.

If you want FTP over SSL, you would need to change the port in your command from port 22 to the FTP port (21 by default).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.