我可以使用带有 SFTP 协议的 filezilla 成功连接到 ftp 服务器。
但是当我尝试使用 lftp 连接并发送ls
列出远程文件夹的命令时,它只是一直显示状态连接......
这是我的 lftp 命令:
$ lftp -p 22222 -u dev001 sftp://111.222.333.444
Password:
lftp [email protected]:~> debug
lftp [email protected]:~> ls
---- Running connect program (ssh -a -x -s -l dev001 -p 22222 111.222.333.444 sftp)
---> sending a packet, length=5, type=1(INIT), id=0
The authenticity of host '[111.222.333.444]:22222 ([111.222.333.444]:22222)' can't be established.
<--- RSA key fingerprint is SHA256:xxxxxxxxxxxx/yyyyyy/zzzzzzzzz.
`ls' at 0 [Connecting...]
请赐教
谢谢
答案1
发布问题几分钟后,看起来我可以解决它了:D
我尝试使用 sftp 命令行进行连接,它要求保存指纹,然后成功连接并完美运行。
$ sftp -P 22222 [email protected]
然后我重试 lftp... 并且... 它成功了 :D
$ lftp -p 22222 -u dev001 sftp://111.222.333.444
Password:
lftp [email protected]:~> debug
lftp [email protected]:~> ls
---- Running connect program (ssh -a -x -s -l dev001 -p 22222 111.222.333.444 sftp)
---> sending a packet, length=5, type=1(INIT), id=0
`ls' at 0 [Connecting...]
[email protected]'s password: XXXX
<--- got a packet, length=95, type=2(VERSION), id=0
---- protocol version set to 3
---> sending a packet, length=10, type=16(REALPATH), id=1
<--- got a packet, length=57, type=104(NAME), id=1
---- home set to /sftp/dev001/app
---- path on wire is `/sftp/dev001/app'
---> sending a packet, length=27, type=11(OPENDIR), id=2
<--- got a packet, length=13, type=102(HANDLE), id=2
---- got file handle 00000000 (4)
---> sending a packet, length=13, type=12(READDIR), id=3
<--- got a packet, length=6395, type=104(NAME), id=3
---- file name count=53
---> sending a packet, length=13, type=12(READDIR), id=4
---> sending a packet, length=13, type=12(READDIR), id=5
<--- got a packet, length=28, type=101(STATUS), id=4
---- status code=1(EOF), message=End of file
---- eof
drwxr-xr-x 17 dev001 sftpusers 4096 Aug 29 16:03 .
drwxr-xr-x 3 root root 4096 Dec 23 2015 ..
-rw-r--r-- 1 dev001 sftpusers 96 May 11 2016 .arcconfig
-rw------- 1 dev001 sftpusers 11022 Jul 4 2022 .bash_history
<deleted>
---> sending a packet, length=13, type=4(CLOSE), id=6
<--- got a packet, length=28, type=101(STATUS), id=5
---- status code=1(EOF), message=End of file
<--- got a packet, length=24, type=101(STATUS), id=6
---- status code=0(OK), message=Success
问题是 lftp 没有询问是否将指纹保存到 known_host。我不确定为什么,也许有一个选项可以激活它。
谢谢,希望对其他人有帮助。
干杯