解决linux ssh客户端SSH连接linux服务器很慢的问题
在linux上使用ssh客戶端連接另一臺的linux服務器時,出現了連接慢的情況。但是換一臺客戶端去連發現速度正常。推測ssh客戶端出現為問題。
于是使用使用ssh -v ?IP 調試,果然發現問題。輸出如下:
[root@jump1 ~]# ssh -v 10.60.9.32
OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 10.60.9.32 [10.60.9.32] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/identity-cert type -1
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: identity file /root/.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.3
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<1024<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: Host '10.60.9.32' is known and matches the RSA host key.
debug1: Found key in /root/.ssh/known_hosts:9
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-with-mic,password
debug1: Next authentication method: gssapi-with-mic
可在最后一條,應該和“?gssapi-with-mic”有關,經過排查,終于發現問題,果然是ssh客戶端文件有問題。是ssh客戶端連接時會進行反向查詢所致。
修改方法如下:
修改本機的客戶端配置文件ssh_config,注意,不是ssh_config
vi /etc/ssh/ssh_config
找到?
GSSAPIAuthentication yes?
改為?
GSSAPIAuthentication no?
再去試一下,速度正常了
轉載于:https://blog.51cto.com/koala003/1689914
總結
以上是生活随笔為你收集整理的解决linux ssh客户端SSH连接linux服务器很慢的问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Hadoop SequnceFile.W
- 下一篇: BZOJ 3224: Tyvj 1728