在 Filezilla 中移动文件时出现断开连接:没有可用的受支持的身份验证方法(服务器发送:公钥)

在 Filezilla 中移动文件时出现断开连接:没有可用的受支持的身份验证方法(服务器发送:公钥)

我在本地计算机上为 AWS 实例生成了一个新的 SSH 密钥(使用密码)。然后通过 SSH 进入该实例,并将我的公钥上传到authorized_keys.

我以前可以连接和移动文件(获取和放置)成功通过终端 (STFP)。但在 FileZilla 中,我能够连接并查看所有文件,并从本地计算机移动到服务器,但不是从服务器到我的本地机器.FileZilla 一直显示:

Disconnected: No supported authentication methods available (server sent: publickey)

造成这种情况的原因是什么?

更新:日志

Status:         Connecting to 35.181.**.***...
Trace:          CControlSocket::SendNextCommand()
Trace:          CSftpDeleteOpData::Send() in state 0
Trace:          Going to execute /Applications/FileZilla.app/Contents/MacOS//fzsftp
Response:   fzSftp started, protocol_version=8
Trace:          CSftpDeleteOpData::ParseResponse() in state 0
Trace:          CControlSocket::SendNextCommand()
Trace:          CSftpDeleteOpData::Send() in state 2
Command:    keyfile "/Users/****/Desktop/svParis.ppk"
Trace:          CSftpDeleteOpData::ParseResponse() in state 2
Trace:          CControlSocket::SendNextCommand()
Trace:          CSftpDeleteOpData::Send() in state 3
Command:    open "[email protected].**.***" 22
Trace:          Connecting to 35.181.**.*** port 22
Trace:          We claim version: SSH-2.0-FileZilla_3.43.0
Trace:          Server version: SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.8
Trace:          Using SSH protocol version 2
Trace:          Doing ECDH key exchange with curve Curve25519 and hash SHA-256
Trace:          Server also has ecdsa-sha2-nistp256/ssh-rsa host keys, but we don't know any of them
Trace:          Host key fingerprint is:
Trace:          ssh-ed25519 256 62:2b:a1:ac:13:74:1a:c5:56:bf:82:74:d0:28:e2:8c HnCtld7UjEMzLCnnbrUUy9EVFmFMHI0fg7QnLBzqbCk=
Trace:          CSftpControlSocket::SetAsyncRequestReply
Command:    Trust new Hostkey: Once
Trace:          Initialised AES-256 GCM client->server encryption
Trace:          Initialised AES256 GCM client->server MAC algorithm (in ETM mode) (required by cipher)
Trace:          Initialised AES-256 GCM server->client encryption
Trace:          Initialised AES256 GCM server->client MAC algorithm (in ETM mode) (required by cipher)
Trace:          Pageant is running. Requesting keys.
Trace:          Pageant has 0 SSH-2 keys
Trace:          Private key in '/Users/****/Desktop/svParis.ppk' is encrypted, defer loading until use.
Trace:          Successfully loaded 1 key pair from file
Trace:          Offered public key from "/Users/****/Desktop/svParis.ppk"
Trace:          Offer of public key accepted, trying to authenticate using it.
Trace:          CSftpControlSocket::SetAsyncRequestReply
Command:    Pass: ***********
Trace:          Access granted
Trace:          Opening session as main channel
Trace:          Opened main channel
Trace:          Started a shell/command
Status:         Connected to 35.181.**.***
Trace:          CSftpDeleteOpData::ParseResponse() in state 3
Trace:          CControlSocket::ResetOperation(0)
Trace:          CSftpDeleteOpData::Reset(0) in state 3
Trace:          CFileZillaEnginePrivate::ResetOperation(0)
Status:         Retrieving directory listing...
Trace:          CControlSocket::SendNextCommand()
Trace:          CSftpListOpData::Send() in state 0
Trace:          CSftpChangeDirOpData::Send() in state 0
Trace:          CSftpChangeDirOpData::Send() in state 1
Command:    pwd
Response:   Current directory is: "/home/ubuntu"
Trace:          CSftpChangeDirOpData::ParseResponse() in state 1
Trace:          CControlSocket::ResetOperation(0)
Trace:          CSftpChangeDirOpData::Reset(0) in state 1
Trace:          CSftpListOpData::SubcommandResult(0) in state 1
Trace:          CControlSocket::SendNextCommand()
Trace:          CSftpListOpData::Send() in state 2
Trace:          CControlSocket::ResetOperation(0)
Trace:          CSftpListOpData::Reset(0) in state 2
Status:         Directory listing of "/home/ubuntu" successful
Trace:          CFileZillaEnginePrivate::ResetOperation(0)
Trace:          CFileZillaEnginePrivate::ResetOperation(0)
Status:         Disconnected from server
Trace:          CControlSocket::DoClose(66)
Trace:          CControlSocket::DoClose(66)
Trace:          CControlSocket::DoClose(66)
Trace:          CFileZillaEnginePrivate::ResetOperation(0)
Status:         Connecting to 35.181.**.***...
Trace:          CControlSocket::SendNextCommand()
Trace:          CSftpDeleteOpData::Send() in state 0
Trace:          Going to execute /Applications/FileZilla.app/Contents/MacOS//fzsftp
Response:   fzSftp started, protocol_version=8
Trace:          CSftpDeleteOpData::ParseResponse() in state 0
Trace:          CControlSocket::SendNextCommand()
Trace:          CSftpDeleteOpData::Send() in state 2
Command:    keyfile "/Users/****/Desktop/ParisInstance.ppk"
Trace:          CSftpDeleteOpData::ParseResponse() in state 2
Trace:          CControlSocket::SendNextCommand()
Trace:          CSftpDeleteOpData::Send() in state 3
Command:    open "[email protected].**.***" 22
Trace:          Connecting to 35.181.**.*** port 22
Trace:          We claim version: SSH-2.0-FileZilla_3.43.0
Trace:          Server version: SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.8
Trace:          Using SSH protocol version 2
Trace:          Doing ECDH key exchange with curve Curve25519 and hash SHA-256
Trace:          Server also has ecdsa-sha2-nistp256/ssh-rsa host keys, but we don't know any of them
Trace:          Host key fingerprint is:
Trace:          ssh-ed25519 256 62:2b:a1:ac:13:74:1a:c5:56:bf:82:74:d0:28:e2:8c HnCtld7UjEMzLCnnbrUUy9EVFmFMHI0fg7QnLBzqbCk=
Trace:          CSftpControlSocket::SetAsyncRequestReply
Command:    Trust new Hostkey: Once
Trace:          Initialised AES-256 GCM client->server encryption
Trace:          Initialised AES256 GCM client->server MAC algorithm (in ETM mode) (required by cipher)
Trace:          Initialised AES-256 GCM server->client encryption
Trace:          Initialised AES256 GCM server->client MAC algorithm (in ETM mode) (required by cipher)
Trace:          Pageant is running. Requesting keys.
Trace:          Pageant has 0 SSH-2 keys
Trace:          Successfully loaded 1 key pair from file
Trace:          Offered public key from "/Users/****/Desktop/ParisInstance.ppk"
Trace:          Server refused our key
Trace:          Disconnected: No supported authentication methods available (server sent: publickey)
Error:          Disconnected: No supported authentication methods available (server sent: publickey)
Trace:          CSftpControlSocket::OnTerminate without error
Trace:          CControlSocket::DoClose(66)
Trace:          CControlSocket::ResetOperation(66)
Trace:          CSftpDeleteOpData::Reset(66) in state 3
Error:          Could not connect to server
Trace:          CFileZillaEnginePrivate::ResetOperation(66)
Status:         Disconnected from server
Trace:          CControlSocket::DoClose(66)
Trace:          CControlSocket::DoClose(66)
Trace:          CControlSocket::DoClose(66)
Trace:          CFileZillaEnginePrivate::ResetOperation(0)
Status:         Delaying connection for 5 seconds due to previously failed connection attempt...
Status:         Connecting to 35.181.**.***...
Trace:          CControlSocket::SendNextCommand()
Trace:          CSftpDeleteOpData::Send() in state 0
Trace:          Going to execute /Applications/FileZilla.app/Contents/MacOS//fzsftp
Response:   fzSftp started, protocol_version=8
Trace:          CSftpDeleteOpData::ParseResponse() in state 0
Trace:          CControlSocket::SendNextCommand()
Trace:          CSftpDeleteOpData::Send() in state 2
Command:    keyfile "/Users/****/Desktop/ParisInstance.ppk"
Trace:          CSftpDeleteOpData::ParseResponse() in state 2
Trace:          CControlSocket::SendNextCommand()
Trace:          CSftpDeleteOpData::Send() in state 3
Command:    open "[email protected].**.***" 22
Trace:          Connecting to 35.181.**.*** port 22
Trace:          We claim version: SSH-2.0-FileZilla_3.43.0
Trace:          Server version: SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.8
Trace:          Using SSH protocol version 2
Trace:          Doing ECDH key exchange with curve Curve25519 and hash SHA-256
Trace:          Server also has ecdsa-sha2-nistp256/ssh-rsa host keys, but we don't know any of them
Trace:          Host key fingerprint is:
Trace:          ssh-ed25519 256 62:2b:a1:ac:13:74:1a:c5:56:bf:82:74:d0:28:e2:8c HnCtld7UjEMzLCnnbrUUy9EVFmFMHI0fg7QnLBzqbCk=
Trace:          CSftpControlSocket::SetAsyncRequestReply
Command:    Trust new Hostkey: Once
Trace:          Initialised AES-256 GCM client->server encryption
Trace:          Initialised AES256 GCM client->server MAC algorithm (in ETM mode) (required by cipher)
Trace:          Initialised AES-256 GCM server->client encryption
Trace:          Initialised AES256 GCM server->client MAC algorithm (in ETM mode) (required by cipher)
Trace:          Pageant is running. Requesting keys.
Trace:          Pageant has 0 SSH-2 keys
Trace:          Successfully loaded 1 key pair from file
Trace:          Offered public key from "/Users/****/Desktop/ParisInstance.ppk"
Trace:          Server refused our key
Trace:          Disconnected: No supported authentication methods available (server sent: publickey)
Error:          Disconnected: No supported authentication methods available (server sent: publickey)
Trace:          CSftpControlSocket::OnTerminate without error
Trace:          CControlSocket::DoClose(66)
Trace:          CControlSocket::ResetOperation(66)
Trace:          CSftpDeleteOpData::Reset(66) in state 3
Error:          Could not connect to server
Trace:          CFileZillaEnginePrivate::ResetOperation(66)
Status:         Disconnected from server
Trace:          CControlSocket::DoClose(66)
Trace:          CControlSocket::DoClose(66)
Trace:          CControlSocket::DoClose(66)
Trace:          CFileZillaEnginePrivate::ResetOperation(0)
Status:         Delaying connection for 5 seconds due to previously failed connection attempt...
Status:         Connecting to 35.181.**.***...
Trace:          CControlSocket::SendNextCommand()
Trace:          CSftpDeleteOpData::Send() in state 0
Trace:          Going to execute /Applications/FileZilla.app/Contents/MacOS//fzsftp
Response:   fzSftp started, protocol_version=8
Trace:          CSftpDeleteOpData::ParseResponse() in state 0
Trace:          CControlSocket::SendNextCommand()
Trace:          CSftpDeleteOpData::Send() in state 2
Command:    keyfile "/Users/****/Desktop/ParisInstance.ppk"
Trace:          CSftpDeleteOpData::ParseResponse() in state 2
Trace:          CControlSocket::SendNextCommand()
Trace:          CSftpDeleteOpData::Send() in state 3
Command:    open "[email protected].**.***" 22
Trace:          Connecting to 35.181.**.*** port 22
Trace:          We claim version: SSH-2.0-FileZilla_3.43.0
Trace:          Server version: SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.8
Trace:          Using SSH protocol version 2
Trace:          Doing ECDH key exchange with curve Curve25519 and hash SHA-256
Trace:          Server also has ecdsa-sha2-nistp256/ssh-rsa host keys, but we don't know any of them
Trace:          Host key fingerprint is:
Trace:          ssh-ed25519 256 62:2b:a1:ac:13:74:1a:c5:56:bf:82:74:d0:28:e2:8c HnCtld7UjEMzLCnnbrUUy9EVFmFMHI0fg7QnLBzqbCk=
Trace:          CSftpControlSocket::SetAsyncRequestReply
Command:    Trust new Hostkey: Once
Trace:          Initialised AES-256 GCM client->server encryption
Trace:          Initialised AES256 GCM client->server MAC algorithm (in ETM mode) (required by cipher)
Trace:          Initialised AES-256 GCM server->client encryption
Trace:          Initialised AES256 GCM server->client MAC algorithm (in ETM mode) (required by cipher)
Trace:          Pageant is running. Requesting keys.
Trace:          Pageant has 0 SSH-2 keys
Trace:          Successfully loaded 1 key pair from file
Trace:          Offered public key from "/Users/****/Desktop/ParisInstance.ppk"
Trace:          Server refused our key
Trace:          Disconnected: No supported authentication methods available (server sent: publickey)
Error:          Disconnected: No supported authentication methods available (server sent: publickey)
Trace:          CSftpControlSocket::OnTerminate without error
Trace:          CControlSocket::DoClose(66)
Trace:          CControlSocket::ResetOperation(66)
Trace:          CSftpDeleteOpData::Reset(66) in state 3
Error:          Could not connect to server
Trace:          CFileZillaEnginePrivate::ResetOperation(66)

FileZilla 版本:3.43.0(最新)操作系统:MacOS Mojave 10.14.5

正如您所看到的,连接成功Directory listing of "/var/www/html" successful,然后我移动了一个文件(从服务器到本地),但仍然收到错误。

更新 2: 现在我明白问题所在了。FileZilla 最初使用 svParis.ppk 进行连接,然后当我尝试移动文件时,它使用 ParisInstance.ppk(我更改的旧密钥)。

为什么会发生这种情况?是因为我手动将公钥添加到我的实例(而不是从 AWS 控制台添加)吗?

答案1

解决~/.config/fiezilla在 FileZilla 关闭时删除该文件夹。

为什么: 扫描配置文件夹,显示我的旧密钥ParisInstance.ppk仍然写入其中一个文件 ( filezilla.xml),尽管sitemanager.xml密钥正确。但是,删除文件夹、启动 FileZilla 并再次添加服务器连接信息后,它就正常工作了。

相关内容