服务器端没有其他任何改变。然而,在我最近的MacOS更新之后,我得到了kex_exchange_identification: read: Connection reset by peer
四处搜寻,无法修复。请帮帮忙。谢谢。
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发布于 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。
sudo chmod 600 /etc/ssh/*_key
sudo chmod 644 /etc/ssh/*.pub您还应该验证SSH客户端对~/.ssh和公共/私钥、配置、authorized_keys等具有正确的权限。尽管如果这些权限是错误的,那么您将立即被告知存在权限问题。但是,当SSH守护进程的键权限错误时,您将在日志中接收错误。不包括用于SSH密码免费登录的公钥。
如果不是DNS或证书,则始终是权限。
https://stackoverflow.com/questions/69224837
复制相似问题