我已将我的Mac升级到Mountain Lion。 现在它已经完成了,我无法连接到任何服务器超过几秒钟,我无法接收任何SSH连接。
我只能假设从升级已经造成的问题。 我能做些什么来诊断错误并修复它? 我想使用用户名jjasonclark连接到其他系统,我希望其他人使用用户名jjasonclark连接到我的系统。
我在/var/log/system.log没有关于ssh的日志。 我没有一个名为/var/log/secure.log的文件。 而通过syslog -d /var/log/asl查看ssh只显示了我编辑/etc/sshd_config文件的时间。
当其他人尝试连接到我(使用-vvv选项)时,他们的客户端将挂起此消息。
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
从我的机器连接到其他人的示例ssh -vvv jjasonclark.analoganalytics.com
OpenSSH_5.9p1, OpenSSL 0.9.8r 8 Feb 2011 debug1: Reading configuration data /usr/local/Cellar/openssh/5.9p1/etc/ssh_config debug2: ssh_connect: needpriv 0 debug1: Connecting to jjasonclark.analoganalytics.com [184.106.115.234] port 22. debug1: Connection established. debug3: Incorrect RSA1 identifier debug3: Could not load "/Users/jjasonclark/.ssh/id_rsa" as a RSA1 public key debug1: identity file /Users/jjasonclark/.ssh/id_rsa type 1 debug1: identity file /Users/jjasonclark/.ssh/id_rsa-cert type -1 debug1: identity file /Users/jjasonclark/.ssh/id_dsa type -1 debug1: identity file /Users/jjasonclark/.ssh/id_dsa-cert type -1 debug1: identity file /Users/jjasonclark/.ssh/id_ecdsa type -1 debug1: identity file /Users/jjasonclark/.ssh/id_ecdsa-cert type -1 debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3 debug1: match: OpenSSH_4.3 pat OpenSSH_4* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_5.9 debug2: fd 3 setting O_NONBLOCK debug3: load_hostkeys: loading entries for host "jjasonclark.analoganalytics.com" from file "/Users/jjasonclark/.ssh/known_hosts" debug3: load_hostkeys: found key type RSA in file /Users/jjasonclark/.ssh/known_hosts:37 debug3: load_hostkeys: found key type RSA in file /Users/jjasonclark/.ssh/known_hosts:38 debug3: load_hostkeys: loaded 2 keys debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],[email protected],ssh-rsa debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: [email protected],[email protected],ssh-rsa,[email protected],[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-dss debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected] debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected] debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: none,[email protected],zlib debug2: kex_parse_kexinit: none,[email protected],zlib debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa,ssh-dss debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected] debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected] debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: none,[email protected] debug2: kex_parse_kexinit: none,[email protected] debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: mac_setup: found hmac-md5 debug1: kex: server->client aes128-ctr hmac-md5 none debug2: mac_setup: found hmac-md5 debug1: kex: client->server aes128-ctr hmac-md5 none debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
我的/etc/syslog.conf
# Note that flat file logs are now configured in /etc/asl.conf install.* @127.0.0.1:32376
我的/etc/sshd_config
Protocol 2 SyslogFacility AUTHPRIV LogLevel INFO PermitRootLogin no PubkeyAuthentication yes PasswordAuthentication no PermitEmptyPasswords no ChallengeResponseAuthentication no ClientAliveInterval 120 ClientAliveCountMax 3 AcceptEnv LANG LC_* AllowUsers jjasonclark remotepair
我的/etc/ssh_config
Host * SendEnv LANG LC_* ServerAliveInterval 60
解决了!
解决这个问题是一个奇怪的问题。 原来,我需要重置我的PRAM。 它必须存储一些需要随升级而改变的细节。
苹果有一篇关于如何重置PRAM的文章 。 您重新启动并按住cmd + opt + p + r直到第二次听到。