Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

lftp: "FEAT negotiation" message when I try to sync a remote (no SSL) folder with a local folder

Tags:

linux

debian

lftp

I want to sync a remote folder with a local folder using lftp.

When I installed the first time "lftp" and I created this script:

#!/bin/bash

#get username and password
USER=...        #Your username
PASS=...        #Your password
HOST="..."         #Keep just the address

echo Sync started ...

LCD="/var/www/myfolder/app"    #Your local directory
RCD="/app"                   #FTP server directory

lftp -f "
open $HOST
user $USER $PASS
lcd $LCD
mirror --continue --reverse --delete --no-symlinks --exclude .gitkeep --exclude .gitignore --exclude .bower.json --verbose $LCD $RCD
bye
"

Everything worked like a charm.

After that, I tried to compile lftp with SSL support (I downloaded the source, compiled in a deb package and installed it) to sync to an SSL FTP server. I did not figure out, but I did not need any more, so I wanted to come back to the start situation.

Now, even if I remove lftp and I install it again without SSL, when I execute the script I get this message:

mkdir `/app' [FEAT negotiation...]

The command just goes in timeout (I saw it with the debug). How can I solve it?

like image 776
Giacomo M Avatar asked Nov 30 '22 15:11

Giacomo M


1 Answers

I have faced the exact same problem. It was resolved by explicitly providing a protocol prefix 'sftp' in the connection string. By default lftp uses 'ftp' as a protocol.

HOST="sftp://<hostname>" # <-- make sure that you have specified the protocol here

lftp <<EOF 
set ssl:verify-certificate no  
set sftp:auto-confirm yes
open $HOST -p $PORT -u $USER,$PASSWORD
mirror $RCD $LCD
EOF
like image 62
Konstantin Knyazkov Avatar answered Dec 06 '22 09:12

Konstantin Knyazkov