tha*_*one 7 ssh remote openssh
虽然本网站和其他网站上有很多问题都在解决这个问题,但我还没有找到一个似乎能解决我所遇到的问题。
尝试从运行 Lion 的 MBpro ssh linux 机器时,出现以下错误:
gjohnson5@Gentrys-MacBook-Pro:~$ ssh -v user@server_name
OpenSSH_5.6p1, OpenSSL 0.9.8y 5 Feb 2013
debug1: Reading configuration data /etc/ssh_config
debug1: Applying options for *
debug1: Connecting to server_name[ip_address] port 22.
debug1: Connection established.
debug1: identity file /Users/gjohnson5/.ssh/id_rsa type -1
debug1: identity file /Users/gjohnson5/.ssh/id_rsa-cert type -1
debug1: identity file /Users/gjohnson5/.ssh/id_dsa type -1
debug1: identity file /Users/gjohnson5/.ssh/id_dsa-cert type -1
ssh_exchange_identification: Connection closed by remote host
Run Code Online (Sandbox Code Playgroud)
奇怪的是我间歇性地收到这个错误。有时重新启动我的机器并重试将使我进入服务器没问题。其他时候,错误仍然存在。偶尔,我会成功登录,关闭连接,几秒钟后尝试重新连接,然后收到错误。
现在,我尝试清除~/.ssh/known_hosts
文件,但我发现尝试在同一台机器上以不同用户身份登录仍然会引发错误。我无法检查/etc/hosts.allow
,/etc/hosts.deny
因为我无法访问服务器,不幸的是,我雇主的 IT 没有响应。然而,我无法想象这会是问题所在,因为我偶尔能够使用我的机器登录服务器。似乎问题可能出在我的机器上的某些配置上(??),尽管我对此相对缺乏经验并且不知道从哪里开始寻找。
编辑:根据请求,这是检查 MaxStartups 的结果:
grep MaxStartups /etc/ssh/sshd_config
#MaxStartups 10:30:60
Run Code Online (Sandbox Code Playgroud)
小智 5
如果碰巧有更多数量的传入请求,则可能会出现此问题。
一旦未经身份验证的连接数超过 sshd:MaxStartUps 参数,sshd 就会开始拒绝这些连接。
所以最好增加sshd_config中的MaxStartups
哼!