【问题标题】:Debian Wheezy Places > Connect To Server Host Key Verification FailedDebian Wheezy Places > 连接到服务器主机密钥验证失败
【发布时间】:2014-07-08 00:20:28
【问题描述】:

我有一个笨蛋。首先让我说以前这工作正常,但是由于我对我的 sshd_config 文件进行了一些更改(为了增加安全性),我无法使用

连接到我的 Debian Wheezy 盒子(从另一个 Deb Wheezy 盒子)
Places > Connect To Server options.

我会说我可以通过 ssh 通过 root 终端在盒子之间来回连接,但我无法使用相同的 root 登录从一个盒子连接到另一个盒子。有人对此有任何想法吗?

我在主机 (/var/log/auth.log) 上遇到的唯一日志错误是 Connection closed by XXX.XXX.XXX.XXX [preauth]。当然,客户端机器上没有日志条目。

这是我在主机上的sshd_config 文件(为了便于阅读,删除了注释掉的行):

Port 22
Protocol
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
UsePrivilegeSeparation yes
KeyRegenerationInterval 3600
ServerKeyBits 768
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120
PermitRootLogin yes
StrictModes no
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile  %h/.ssh/authorized_keys
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no
PasswordAuthentication yes
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
Banner /etc/ssh/ssh.banner
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM no

这是来自我的 CLIENT 机器的 ssh_config 文件(同样,注释掉的行已删除)

Host *
PasswordAuthentication yes
IdentityFile ~/.ssh/id_rsa
SendEnv LANG LC_*
HashKnownHosts no
GSSAPIAuthentication yes
GSSAPIDelegateCredentials no

AFAIK,在它正常工作之前我更改的唯一设置是在 sshd_config 文件上,可能只是 PasswordAuthentication RSAAuthentication 和/或 PubKeyAuthentication

有人有什么想法吗?我四处寻找,找不到任何有效的解决方案。

同样,通过终端的 ssh 两种方式都可以正常工作,但不能通过 Places > Connect To Server(设置 SSH,使用 root 用户名和密码设置端口 22。)屏幕上的连接到服务器错误消息显示主机密钥验证失败。

提前感谢您启发我。

【问题讨论】:

  • 感谢您的编辑 hnk。我把配置文件信息搞砸了。有人对此有任何想法吗?顺便说一句,我可以成功连接到其他三台服务器中的两台,只有一台失败。

标签: ssh debian connect


【解决方案1】:

好的。出于文档的目的,我想我会发布我最终偶然发现的这个问题的解决方案。可能是新手的错误,但仍然是:

我实际上通过反复试验发现,实际上当通过 Places > Connect To Server 连接时,您实际上使用的是存储在 /user/.ssh/known_hosts 文件中的主机密钥信息,即使您使用的是用户名: root 和密码 : XXXX 在连接到服务器框中。

因此,清除 /home/USERNAME/.ssh/known_hosts 文件中的 known_hosts 文件,然后就可以开始了。

事实上,我为 root 和 USERNAME 帐户清除了所有机器中的 known_hosts 文件,只是为了确定。

问题解决了!

【讨论】:

    猜你喜欢
    • 2020-07-15
    • 2015-06-13
    • 2018-11-13
    • 1970-01-01
    • 2016-11-27
    • 2021-12-25
    • 2013-02-16
    • 1970-01-01
    • 2018-04-06
    相关资源
    最近更新 更多