OSX ssh:[IP]关闭了连接


0

因此,当我尝试从我的一台Mac SSH切换到另一台Mac时,如下所示:

ssh root@macpro.local

我得到:

Connection closed by 192.168.1.64

我试过了:

ssh -vvv root@macpro.local

并获得:

OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: /etc/ssh_config line 53: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to macbookpro.local [192.168.1.64] port 22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/Users/Andryuwka/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /Users/Andryuwka/.ssh/id_rsa type 1  
debug1: identity file /Users/Andryuwka/.ssh/id_rsa-cert type -1
debug1: identity file /Users/Andryuwka/.ssh/id_dsa type -1
debug1: identity file /Users/Andryuwka/.ssh/id_dsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.2
debug1: match: OpenSSH_6.2 pat OpenSSH*
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
Connection closed by 192.168.1.64

有任何想法吗???


您是否找到了解决方案?我面临“ ssh localhost”的相同问题
MysticForce '16

Answers:


2

看起来ssh服务器未接受ssh客户端要使用的身份验证类型。或通常不允许该根用于ssh访问。查找解决方案的更好方法是访问ssh服务器上的ssh.log。在那里,您会找到详细的信息,为什么拒绝建立连接。

乔·莱德


在ssh服务器上的哪里可以找到此ssh.log?
提请

这取决于您使用的Mac OS X版本。我可以在/var/log/system.log中找到有关版本10.10.X的信息。您是否还打算通过“系统偏好设置”允许ssh登录?看到这里详细介绍了如何做到这一点:osxdaily.com/2011/09/30/remote-login-ssh-server-mac-os-x
莱德

1

不久前我遇到了类似的问题,这对我有所帮助:https : //discussions.apple.com/thread/3008731

tl; dr:文件/ etc / ssh_host_dsa_key的权限应为700,否则ssh连接将失败。

修理:

sudo chmod 700 /etc/ssh_host_dsa_key

谢谢您的答复,但它无济于事。.实际上,我什至拥有该密钥的600权限(它不应该可执行,所以600完全足够了)并且仍然不起作用...
Drew

谢谢。正是我的问题。我的密钥是600,尽管mac ssh客户端会提示输入密码,但是一旦输入密码,我就会“连接关闭”。Chmod'ing到700修复了它。
6

不适用于Mojave 10.14
SPRBRN
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.