首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Kex_exchange_identification更新后的SSH“macOS”错误

Kex_exchange_identification更新后的SSH“macOS”错误
EN

Stack Overflow用户
提问于 2021-09-17 14:09:30
回答 1查看 2.7K关注 0票数 0

服务器端没有其他任何改变。然而,在我最近的MacOS更新之后,我得到了kex_exchange_identification: read: Connection reset by peer

四处搜寻,无法修复。请帮帮忙。谢谢。

代码语言:javascript
复制
ssh xxxx@xx.xx.x.xx -Tv    
OpenSSH_8.1p1, LibreSSL 2.7.3
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 47: Applying options for *
debug1: Connecting to xx.xx.x.xx [xx.xx.x.xx] port 22.
debug1: Connection established.
debug1: identity file /Users/chaowu/.ssh/id_rsa type 0
debug1: identity file /Users/chaowu/.ssh/id_rsa-cert type -1
debug1: identity file /Users/chaowu/.ssh/id_dsa type -1
debug1: identity file /Users/chaowu/.ssh/id_dsa-cert type -1
debug1: identity file /Users/chaowu/.ssh/id_ecdsa type -1
debug1: identity file /Users/chaowu/.ssh/id_ecdsa-cert type -1
debug1: identity file /Users/chaowu/.ssh/id_ed25519 type -1
debug1: identity file /Users/chaowu/.ssh/id_ed25519-cert type -1
debug1: identity file /Users/chaowu/.ssh/id_xmss type -1
debug1: identity file /Users/chaowu/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.1
kex_exchange_identification: read: Connection reset by peer
EN

回答 1

Stack Overflow用户

发布于 2021-11-02 19:34:29

我在macOS Catalina上发现了导致此错误的根本原因是SSH连接到的计算机。在Catalina的升级中有一些bug,可能还有补丁。确保您检查了您试图连接到的Mac系统上/etc/ssh中生成的OpenSSH公钥/私钥文件的权限。这些键由SSH守护进程使用。

由于OpenSSH是跨平台的,这同样适用于任何运行SSHd的操作系统。这些文件必须具有适当的权限。

/etc/ssh是默认路径,但如果您在Windows或其他操作系统上,则可能会有所不同。但是对于大多数Unix/Linux/macOS系统来说,它应该是/etc/ssh。

代码语言:javascript
复制
sudo chmod 600 /etc/ssh/*_key
sudo chmod 644 /etc/ssh/*.pub

您还应该验证SSH客户端对~/.ssh和公共/私钥、配置、authorized_keys等具有正确的权限。尽管如果这些权限是错误的,那么您将立即被告知存在权限问题。但是,当SSH守护进程的键权限错误时,您将在日志中接收错误。不包括用于SSH密码免费登录的公钥。

如果不是DNS或证书,则始终是权限。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69224837

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档