1,问题表现

2,问题原因

3,问题解决

4,检验想法

5,博客记录







1,问题表现

ssh登录 问题的表现:
chunli@linux:~$ ssh chunli@172.16.20.139
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /home/chunli/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 172.16.20.139 [172.16.20.139] port 22.
debug1: Connection established.
debug1: identity file /home/chunli/.ssh/id_rsa type 1
debug1: identity file /home/chunli/.ssh/id_rsa-cert type -1
debug1: identity file /home/chunli/.ssh/id_dsa type -1
debug1: identity file /home/chunli/.ssh/id_dsa-cert type -1
debug1: identity file /home/chunli/.ssh/id_ecdsa type -1
debug1: identity file /home/chunli/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/chunli/.ssh/id_ed25519 type -1
debug1: identity file /home/chunli/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH_5* compat 0x0c000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<3072<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA b4:7f:1f:34:3a:e5:a3:3f:03:6c:de:7f:d9:0e:db:ba
debug1: Host '172.16.20.139' is known and matches the RSA host key.
debug1: Found key in /home/chunli/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received  #阻塞在这里,大约5秒



debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/chunli/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentication succeeded (publickey).
Authenticated to 172.16.20.139 ([172.16.20.139]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = zh_CN.UTF-8
Last login: Thu Feb 23 10:27:51 2017 from 172.16.20.245


[chunli@CentOS ~]$ 
[chunli@CentOS ~]$ 
[chunli@CentOS ~]$



2,问题原因

GSSAPIAuthentication选项的作用:是否允许使用基于 GSSAPI 的用户认证。默认为yes



3,问题解决

登录到对方的Linux  修改ssh服务器配置文件 


[root@CentOS ~]# vim /etc/ssh/sshd_config 
行尾追加以下内容
GSSAPIAuthentication no
GSSAPIAuthentication no
GSSAPICleanupCredentials no
GSSAPICleanupCredentials no
GSSAPIStrictAcceptorCheck no
GSSAPIKeyExchange no
UseDNS no

[root@CentOS src]# service sshd restart




重启sshd
[chunli@CentOS ~]$ sudo service sshd restart
Stopping sshd:                                             [  OK  ]
Starting sshd:                                             [  OK  ]
[chunli@CentOS ~]$



4,检验想法

chunli@linux:~$ ssh chunli@172.16.20.139
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /home/chunli/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 172.16.20.139 [172.16.20.139] port 22.
debug1: Connection established.
debug1: identity file /home/chunli/.ssh/id_rsa type 1
debug1: identity file /home/chunli/.ssh/id_rsa-cert type -1
debug1: identity file /home/chunli/.ssh/id_dsa type -1
debug1: identity file /home/chunli/.ssh/id_dsa-cert type -1
debug1: identity file /home/chunli/.ssh/id_ecdsa type -1
debug1: identity file /home/chunli/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/chunli/.ssh/id_ed25519 type -1
debug1: identity file /home/chunli/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH_5* compat 0x0c000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<3072<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA b4:7f:1f:34:3a:e5:a3:3f:03:6c:de:7f:d9:0e:db:ba
debug1: Host '172.16.20.139' is known and matches the RSA host key.
debug1: Found key in /home/chunli/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/chunli/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentication succeeded (publickey).
Authenticated to 172.16.20.139 ([172.16.20.139]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = zh_CN.UTF-8
Last login: Thu Feb 23 10:28:00 2017 from 172.16.20.245
[chunli@CentOS ~]$




5,博客记录


非常快速的完成登录!