SSH客户端(如PuTTY)ssh远程登录Linux非常慢的解决方法
转:http://blog.useasp.net/archive/2014/05/19/solved-the-problem-of-ssh-client-such-as-putty-remote-login-linux-very-slowly.aspx
ssh -v ssh_test@192.168.128.137
SSH远程登录的时候显示的信息如下
==================================
OpenSSH_6.0p1 Debian-4, OpenSSL 1.0.1e 11 Feb 2013...Some sensitive information...debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3debug1: match: OpenSSH_5.3 pat OpenSSH_5*debug1: Enabling compatibility mode for protocol 2.0debug1: Local version string SSH-2.0-OpenSSH_6.0p1 Debian-4debug1: 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_REPLY...Some sensitive information...debug1: ssh_rsa_verify: signature correctdebug1: SSH2_MSG_NEWKEYS sentdebug1: expecting SSH2_MSG_NEWKEYSdebug1: SSH2_MSG_NEWKEYS receiveddebug1: Roaming not allowed by serverdebug1: 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-micdebug1: Unspecified GSS failure. Minor code may provide more informationCannot determine realm for numeric host addressdebug1: Unspecified GSS failure. Minor code may provide more informationCannot determine realm for numeric host addressdebug1: Unspecified GSS failure. Minor code may provide more informationdebug1: Unspecified GSS failure. Minor code may provide more informationCannot determine realm for numeric host addressdebug1: Next authentication method: publickeydebug1: Trying private key: /home/mitchellchu/.ssh/id_rsadebug1: Trying private key: /home/mitchellchu/.ssh/id_dsadebug1: Trying private key: /home/mitchellchu/.ssh/id_ecdsadebug1: Next authentication method: password从上面可以看到,在CentOS中,系统使用了publickey,gssapi-keyex,gssapi-with-mic,和password来进行认证
下面先放出处理GSSAPI的方法:
禁用GSSAPI认证有两个方式:客户端和服务端
直接配置你ssh客户端的文件
/etc/ssh/ssh_config来达到永久解决这个问题:客户端禁用GSSAPIAuthentication
vi /etc/ssh/ssh_config修改为GSSAPIAuthentication no
服务端禁用GSSAPIAuthentication
vi /etc/ssh/sshd_config修改为GSSAPIAuthentication no
修改为UseDNS no
最后重启SSH服务:service sshd restart
浙公网安备 33010602011771号