简体   繁体   中英

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

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?

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

I've turned FEAT features off, and it worked like a charm. Just use this command before opening a connection:

set ftp:use-feat false

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM