filezilla 中 root 的身份验证失败太多

Jer*_*emy 5 ssh sftp

所以我终于在我的办公室搬到了 Ubuntu!总的来说,我对 Mac 和 Windows 的迁移感到非常满意。我能够解决的大多数问题(显卡问题),但我似乎解决了这个问题,但它不断出现。

我正在使用 Filezilla 并且我有一个自定义的 SSH 配置。我也注意到这也发生在 PHPStorm 上。我假设 FileZilla 的修复程序也将修复 PHPStorm。

我的 SSH 配置是:

# Catch all
Host *
 ServerAliveInterval 120
 ServerAliveCountMax 30
 IdentitiesOnly yes

# Local Dev VM
Host jpCentos devel jp
 HostName jpCentos
 User adminJeremy
 IdentityFile /home/jpsimkins/.ssh/jpCentos
 IdentitiesOnly yes

# Local Dev VM Root (added as work-a-round for filezilla)
Host jpCentosRoot jpRoot
 HostName jpCentos
 User root
 IdentityFile /home/jpsimkins/.ssh/jpCentosRoot
 IdentitiesOnly yes

# Kyle Dev VM
Host kkCentos kk
 HostName kkCentos
 User adminJeremy
 IdentityFile /home/jpsimkins/.ssh/jpCentos
 IdentitiesOnly yes

# Staging Server
Host stagingServer staging stage
 HostName 10.1.1.120
 User adminJeremy
 IdentityFile /home/jpsimkins/.ssh/StagingServer
 IdentitiesOnly yes

# OlympusatV2 PRODuction Server 
Host olympusatV2 v2 live prod
 HostName 166.78.xxx.xxx
 User adminJeremy
 IdentityFile /home/jpsimkins/.ssh/OlympusatV2
 IdentitiesOnly yes

# OlympusatV2 PRODuction Server Root User (added as work-a-round for filezilla)
Host olympusatV2Root v2Root v2root liveroot prodRoot prodroot
 HostName 166.78.xxx.xxx
 User root
 IdentityFile /home/jpsimkins/.ssh/OlympusatV2Root
 IdentitiesOnly yes

# ParablesServer
Host parablesServer ps
 HostName 162.242.xxx.xxx
 User adminJeremy
 IdentityFile /home/jpsimkins/.ssh/ParablesServer
 IdentitiesOnly yes

# ParablesServerRoot  (added as work-a-round for filezilla)
Host parablesServerRoot psRoot psroot ParablesServerRoot
 HostName 162.242.xxx.xxx
 User root
 IdentityFile /home/jpsimkins/.ssh/ParablesServerRoot
 IdentitiesOnly yes
Run Code Online (Sandbox Code Playgroud)

名称 HostName 映射在我的 .hosts 文件中。这使我在办公室之间移动时更容易更新 IP。应该注意的是,即使我使用 IP 代替 .hosts 文件别名,问题也是一样的。

我的问题是,每次我尝试 SFTP 到服务器时,我都会得到:

Command:    open "root@10.1.1.69" 22
Error:  Server sent disconnect message
Error:  type 2 (protocol error):
Error:  "Too many authentication failures for root"
Error:  Could not connect to server
Run Code Online (Sandbox Code Playgroud)

详细的 Filezilla:

Status: Connecting to 10.1.1.69...
Trace:  Going to execute /usr/bin/fzsftp
Response:   fzSftp started
Trace:  CSftpControlSocket::ConnectParseResponse(fzSftp started)
Trace:  CSftpControlSocket::SendNextCommand()
Trace:  CSftpControlSocket::ConnectSend()
Command:    open "root@10.1.1.69" 22
Trace:  Server version: SSH-2.0-OpenSSH_5.3
Trace:  Using SSH protocol version 2
Trace:  We claim version: SSH-2.0-PuTTY_Local:_Sep_14_2013_01:12:43
Trace:  Doing Diffie-Hellman group exchange
Trace:  Doing Diffie-Hellman key exchange with hash SHA-256
Trace:  Host key fingerprint is:
Trace:  ssh-rsa 2048 ae:7c:66:41:8d:5a:18:53:ea:ca:ac:0a:ce:27:cc:4d
Trace:  Initialised AES-256 SDCTR client->server encryption
Trace:  Initialised HMAC-SHA1 client->server MAC algorithm
Trace:  Initialised AES-256 SDCTR server->client encryption
Trace:  Initialised HMAC-SHA1 server->client MAC algorithm
Trace:  Pageant is running. Requesting keys.
Trace:  Pageant has 10 SSH-2 keys
Trace:  Trying Pageant key #0
Trace:  Server refused public key
Trace:  Trying Pageant key #1
Trace:  Server refused public key
Trace:  Trying Pageant key #2
Trace:  CSftpControlSocket::ResetOperation(66)
Trace:  CControlSocket::ResetOperation(66)
Error:  Could not connect to server
Status: Waiting to retry...
Status: Connecting to 10.1.1.69...
Trace:  Going to execute /usr/bin/fzsftp
Response:   fzSftp started
Trace:  CSftpControlSocket::ConnectParseResponse(fzSftp started)
Trace:  CSftpControlSocket::SendNextCommand()
Trace:  CSftpControlSocket::ConnectSend()
Command:    open "root@10.1.1.69" 22
Trace:  Server version: SSH-2.0-OpenSSH_5.3
Trace:  Using SSH protocol version 2
Trace:  We claim version: SSH-2.0-PuTTY_Local:_Sep_14_2013_01:12:43
Trace:  Doing Diffie-Hellman group exchange
Trace:  Doing Diffie-Hellman key exchange with hash SHA-256
Trace:  CSftpControlSocket::ResetOperation(66)
Trace:  CControlSocket::ResetOperation(66)
Error:  Could not connect to server
Run Code Online (Sandbox Code Playgroud)

当我通过终端 SSH 时,我没有问题。

我在某处读到运行:

ssh-add -k ~/.ssh/KEYNAME
Run Code Online (Sandbox Code Playgroud)

会解决这个问题(我不是 100% 确定这是否是修复,我上周尝试了很多不同的事情)但似乎在我重新启动我的机器后它又开始发生了。所以很自然地我尝试再次运行命令但没有骰子。

我是这个东西的新手,但查看日志似乎它正在尝试使用所有密钥进行身份验证,尽管我告诉 SSH 使用 IdentitiesOnly

我删除了,~/.putty因为我之前看到过这个建议,但我仍然收到同样的错误(在接受指纹后)。

任何帮助、想法或建议表示赞赏。我在网上搜索并找不到任何东西,所以如果这是重复的,请告诉我。

谢谢

Paw*_*wan 8

注意:FileZilla 尝试使用 .ssh 目录中的密钥进行连接。

我也有同样的麻烦。对 FileZilla 日志进行一些分析后(可以通过在“编辑”>“首选项”>“调试”中设置调试级别 = 3 来启用调试日志),我注意到filezilla Trying Pageant key #每次尝试向服务器进行身份验证失败时都会打印行。

尝试 5 次失败后,它会断开打印“身份验证失败次数过多”错误。

解决方案:将钥匙移到其他地方。

FileZilla 使用 Pageant 机制并尝试使用已存储在 .ssh 目录中的密钥进行身份验证。我在 .ssh 目录中存储了一些密钥来连接到本地虚拟机。我只是将所有密钥移至 .ssh 中的子目录中。我尝试再次连接,然后 FileZilla 工作正常。


pLu*_*umo 5

我遇到了同样的问题,并找到了比移开钥匙更好的 解决方案。


使用env变量运行 filezilla SSH_AUTH_SOCK=null

SSH_AUTH_SOCK=null filezilla &
Run Code Online (Sandbox Code Playgroud)

对于永久解决方案,请将.desktop文件Exec=行更改为env SSH_AUTH_SOCK=null filezilla

SSH_AUTH_SOCK=null filezilla &
Run Code Online (Sandbox Code Playgroud)


小智 2

您可以通过以下方式在 Mac 上修复此问题:

setting the root password with "sudo passwd root" then
editing and saving the ssh config file with "nano /etc/ssh_config" and
changing the RSAAuthentication to "no" rather than yes.
Run Code Online (Sandbox Code Playgroud)

如果您有任何其他问题,请访问此链接: https://serverfault.com/questions/36291/how-to-recover-from-too-many-authentication-failures-for-user-root