1, problem performance
2, the cause of the problem
3, Problem solving
4, test ideas
5, blog Record
1, problem performance
SSH login problem performance: [Email protected]:~$ ssh [email protected]openssh_6.6.1, openssl 1.0.1f 6 jan 2014debug1: reading configuration data /home/chunli/.ssh /configdebug1: reading configuration data /etc/ssh/ssh_configdebug1: /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 1debug1: identity file /home/ chunli/.ssh/id_rsa-cert type -1debug1: identity file /home/chunli/.ssh/id_dsa type -1debug1: identity file /home/chunli/.ssh/id_dsa-cert type -1debug1: Identity file /home/chunli/.ssh/id_ecdsa type -1debug1: identity file /home /chunli/.ssh/id_ecdsa-cert type -1debug1: identity file /home/chunli/.ssh/id_ed25519 type -1debug1: identity file /home/chunli/.ssh/id_ed25519-cert type -1debug1: enabling compatibility mode for protocol 2.0debug1: local version string ssh-2.0-openssh_6.6.1p1 ubuntu-2ubuntu2.8debug1: remote protocol version 2.0, Remote software version openssh_5.3debug1: match: openssh_5.3 pat openssh_5 * compat 0x0c000000debug1: 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 <3072<8192) sentdebug1: expecting ssh2_msg_kex_dh_gex_groupdebug1: ssh2_msg_kex_dh_ gex_init sentdebug1: expecting  SSH2_MSG_KEX_DH_GEX_REPLYDEBUG1:&NBSP;SERVER&NBSP;HOST&NBSP;KEY:&NBSP;RSA&NBSP;B4:7F:1F:34:3A:E5:A3:3F:03:6C: de:7f:d9:0e:db:badebug1: host ' 172.16.20.139 ' is known and matches the &NBSP;RSA&NBSP;HOST&NBSP;KEY.DEBUG1:&NBSP;FOUND&NBSP;KEY&NBSP;IN&NBSP;/HOME/CHUNLI/.SSH/KNOWN_HOSTS:1DEBUG1: 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 received #阻塞在这里, approx. 5 sec. debug1: authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,passworddebug1: Next authentication method: publickeydebug1: offering rsa public key: /home/ CHUNLI/.SSH/ID_RSADEBUG1:&NBSP;SERVER&NBSP;ACCEPTS&NBSP;KEY:&NBSP;PKALG&NBSP;SSH-RSA&NBSP;BLEN&NBSP;279DEBUG1: authentication succeeded (PublicKey). authenticated to 172.16.20.139 ([172.16.20.139]:22) .debug1: channel 0: new [Client-session]debug1: requesting [email protected]debug1: entering interactive session.debug1: sending environment.debug1: sending env lang = zh_cn. Utf-8last login: thu feb 23 10:27:51 2017 from 172.16.20.245[[email protected] ~]$ [[email protected] ~]$ [[email protected] ~]$
2, the cause of the problem
Gssapiauthentication option: Allows the use of GSSAPI-based user authentication. The default is Yes
3, Problem solving
Log in to the other party's linux modify the SSH server configuration file vim /etc/ssh/ssh_config GSSAPIAuthentication Yes change to gssapiauthentication no[[email protected] ~]$ vim /etc/ssh/ssh_config #$ Openbsd: ssh_config,v 1.25 2009/02/17 01:28:32 djm exp $# this is the ssh client system-wide configuration file. see# ssh_config ( 5) for more information. This file provides defaults for# Users, and the values can be changed in per-user configuration files# or on the command line.# Configuration data is parsed as follows:# 1. command line options# 2. User-specific file# 3. system-wide file# any configuration value is only changed the First time it is set.# thus, host-specific definitions should be at the beginning of the# configuration file, and defaults At the end.# site-wide defaults for some commonly used options. For a comprehensive# list of available options, their Meanings and defaults, please see the# ssh_config (5) man page.# host *# forwardagent no# forwardx11 no# rhostsrsaauthentication no# rsaauthentication yes# passwordauthentication yes# hostbasedauthentication no# gssapiauthentication no# gssapidelegatecredentials no# gssapikeyexchange no# gssapitrustdns no# batchmode no# checkhostip yes# addressfamily any# connecttimeout 0# stricthostkeychecking ask# identityfile ~/.ssh/identity# identityfile ~/.ssh/id_rsa# identityfile ~/.ssh/id_dsa# port 22# protocol &NBSP;2,1#&NBSP;&NBSP;&NBSP;CIPHER&NBSP;3DES#&NBSP;&NBSP;&NBSP;CIPHERS&NBSP;AES128-CTR,AES192-CTR,AES256-CTR, arcfour256,arcfour128,aes128-cbc,3des-cbc# macs hmac-md5,hmac-sha1,[email protected ],hmac-ripemd160# escapechar ~# tunnel no# tunneldevice any:any# permitlocalcommand no# visualhostkey nohost *gssapiauthentication no #默认yes instead of no# if this option is set to yes then remote x11 clients will have full access# to the Original x11 display. as virtually no x11 client supports the untrusted# mode correctly we set this to yes. Forwardx11trusted yes# send locale-related environment variablessendenv lang lc_ctype lc_numeric lc_time lc_collate lc_monetary lc_messages sendenv lc_paper lc_name lc_address lc_telephone lc_measurement sendenv lc_ Identification lc_all languagesendenv xmodifiers Restart sshd[[email protected] ~]$ sudo service sshd restartstopping sshd: [ ok ]starting sshd: [ ok ][[email protected] ~]$
4, test ideas
[Email protected]:~$ ssh [email protected]openssh_6.6.1, openssl 1.0.1f 6 &NBSP;JAN&NBSP;2014DEBUG1:&NBSP;READING&NBSP;CONFIGURATION&NBSP;DATA&NBSP;/HOME/CHUNLI/.SSH/CONFIGDEBUG1: reading configuration data /etc/ssh/ssh_configdebug1: /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 1debug1: identity file /home/chunli/.ssh/id_ rsa-cert type -1debug1: identity file /home/chunli/.ssh/id_dsa type - 1debug1: identity file /home/chunli/.ssh/id_dsa-cert type -1debug1: identity file /home/chunli/.ssh/id_ecdsa type -1debug1: identity file /home/chunli/ . ssh/id_ecdsa-cert type -1debug1: identity file /home/chunli/.ssh/id_ed25519 type -1debug1: identity file /home/chunli/.ssh/id_ed25519-cert type -1debug1: enabling compatibility Mode for protocol 2.0debug1: local version string ssh-2.0-openssh_6.6.1p1 ubuntu-2ubuntu2.8debug1: remote protocol version 2.0, remote software version OpenSSH_5.3debug1: match: OpenSSH_5.3 pat OpenSSH_5* compat 0x0c000000debug1: 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<3072<8192) Sentdebug1: expecting ssh2_msg_kex_dh_gex_groupdebug1: ssh2_msg_kex_dh_gex_init sentdebug1 : expecting ssh2_msg_kex_DH_GEX_REPLYDEBUG1:&NBSP;SERVER&NBSP;HOST&NBSP;KEY:&NBSP;RSA&NBSP;B4:7F:1F:34:3A:E5:A3:3F:03:6C:DE:7F:D9:0E: db:badebug1: host ' 172.16.20.139 ' is known and matches the RSA Host key.debug1: found key in /home/chunli/.ssh/known_hosts:1debug1: ssh_rsa_ Verify: signature correctdebug1: ssh2_msg_newkeys sentdebug1: expecting ssh2_msg _NEWKEYSDEBUG1:&NBSP;SSH2_MSG_NEWKEYS&NBSP;RECEIVEDDEBUG1:&NBSP;SSH2_MSG_SERVICE_REQUEST&NBSP;SENTDEBUG1: ssh2_msg_service_accept receiveddebug1: authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,passworddebug1: Next authentication method: Publickeydebug1: offering rsa public key: /home/chunli/.ssh/id_rsadebug1: server accepts key: pkalg ssh-rsa blen 279debug1: authentication succeeded (PublicKey). Authenticated to 172.16.20.139 ([172.16.20.139]:22). debug1: channel 0: new [ client-session]debug1: requesting [email protected]debug1: entering interactive Session.debug1: sending environment.debug1: sending env lang = zh_cn. Utf-8last login: thu feb 23 10:28:00 2017 from 172.16.20.245[[email protected] ~]$
5, blog Record
Very fast to complete login!
This article is from the "Soul Bucket" blog, please be sure to keep this source http://990487026.blog.51cto.com/10133282/1900468
Linux SSH Login Slow problem Resolution