简体   繁体   English

lftp:当我尝试将远程(无 SSL)文件夹与本地文件夹同步时出现“FEAT协商”消息

[英]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.我想使用 lftp 将远程文件夹与本地文件夹同步。

When I installed the first time "lftp" and I created this script:当我第一次安装“lftp”并创建了这个脚本时:

#!/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.之后,我尝试编译支持 SSL 的 lftp(我下载了源代码,在deb包中编译并安装了它)以同步到 SSL FTP 服务器。 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:现在,即使我删除 lftp 并在没有 SSL 的情况下再次安装它,当我执行脚本时,我也会收到以下消息:

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.它是通过在连接字符串中显式提供协议前缀“sftp”来解决的。 By default lftp uses 'ftp' as a protocol.默认情况下,lftp 使用“ftp”作为协议。

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.我已经关闭了 FEAT 功能,它就像一个魅力。 Just use this command before opening a connection:只需在打开连接之前使用此命令:

set ftp:use-feat false

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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