SSH 连接慢: Get POSSIBLE BREAK-IN ATTEMPT msg when i ssh to s server

来源:互联网 发布:知乎周刊 pdf 下载 编辑:程序博客网 时间:2024/05/16 06:55

核心:

服务器端sshd配置文件 /etc/ssh/sshd_config 看是否有如下的两条配置条目

GSSAPIAuthentication noUseDNS no

如果前面带#,请把#删掉,或者新添加入这样两行。
然后重启sshd服务,或者重启服务器也可以。

注意是文件 /etc/ssh/sshd_config 而不是/etc/ssh/ssh_config


ssh 登录远程服务器,速度非常慢,通过网上查询,发现有一个参数 -v 可以输出显示连接的具体消息。于是连接加上这个参数连接

[feng@fsc ~]$ ssh -v foo.path8.netOpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010debug1: Reading configuration data /etc/ssh/ssh_configdebug1: Applying options for *debug1: Connecting to v.path8.net [64.120.xxx.xxx] port 22.debug1: Connection established.debug1: identity file /home/feng/.ssh/identity type -1debug1: identity file /home/feng/.ssh/id_rsa type 1debug1: identity file /home/feng/.ssh/id_dsa type -1debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3debug1: match: OpenSSH_5.3 pat OpenSSH*debug1: Enabling compatibility mode for protocol 2.0debug1: Local version string SSH-2.0-OpenSSH_5.3debug1: SSH2_MSG_KEXINIT sentdebug1: SSH2_MSG_KEXINIT receiveddebug1: kex: server->client aes128-ctr hmac-md5 nonedebug1: kex: client->server aes128-ctr hmac-md5 nonedebug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sentdebug1: expecting SSH2_MSG_KEX_DH_GEX_GROUPdebug1: SSH2_MSG_KEX_DH_GEX_INIT sentdebug1: expecting SSH2_MSG_KEX_DH_GEX_REPLYdebug1: Host 'v.path8.net' is known and matches the RSA host key.debug1: Found key in /home/feng/.ssh/known_hosts:4debug1: ssh_rsa_verify: signature correctdebug1: SSH2_MSG_NEWKEYS sentdebug1: expecting SSH2_MSG_NEWKEYSdebug1: SSH2_MSG_NEWKEYS receiveddebug1: SSH2_MSG_SERVICE_REQUEST sentdebug1: SSH2_MSG_SERVICE_ACCEPT receiveddebug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,passworddebug1: Next authentication method: gssapi-keyexdebug1: No valid Key exchange contextdebug1: Next authentication method: gssapi-with-mic/*--------- 这里停留的十多秒钟时间 ----------*/reverse mapping checking getaddrinfo for srv3.mktmaster.net [64.120.xxx.xxx] failed - POSSIBLE BREAK-IN ATTEMPT!debug1: Unspecified GSS failure.  Minor code may provide more informationCredentials cache file '/tmp/krb5cc_501' not founddebug1: Unspecified GSS failure.  Minor code may provide more informationCredentials cache file '/tmp/krb5cc_501' not founddebug1: Unspecified GSS failure.  Minor code may provide more informationdebug1: Next authentication method: publickeydebug1: Offering public key: /home/feng/.ssh/id_rsadebug1: Server accepts key: pkalg ssh-rsa blen 277debug1: Authentication succeeded (publickey).debug1: channel 0: new [client-session]debug1: Requesting no-more-sessions@openssh.comdebug1: Entering interactive session.debug1: Sending environment.debug1: Sending env XMODIFIERS = @im=ibusdebug1: Sending env LANG = zh_CN.utf8Last login: Mon Oct 24 10:26:30 2011 from 124.79.xxx.xxx[feng@v ~]$

大概就是GSSAPIAuthentication这个参数的问题了,之前就是因为连接速度慢,网上查,说是/etc/ssh/sshd_config 里加入参数 UseDNS no,再加个GSSAPIAuthentication yes, 结果速度还是慢。
于是去把这行改为GSSAPIAuthentication no,重启服务器端的ssdh服务,再次连接,速度快多了。