zoukankan      html  css  js  c++  java
  • ssh登录慢解决办法

    这两天ssh登录局域网的一台服务器非常慢,严重影响工作效率,怎么办?查了一下网上的解决办法,总结一下:

    使用命令ssh -v xxx@x.x.x.x

    可以看到debug信息,找到问题出在哪:

    debug1: Authentications that can continue: publickey,gssapi-with-mic,password
    debug1: Next authentication method: gssapi-with-mic
    debug1: Unspecified GSS failure. Minor code may provide more information
    Cannot determine realm for numeric host address

    debug1: Unspecified GSS failure. Minor code may provide more information
    Cannot determine realm for numeric host address

    debug1: Unspecified GSS failure. Minor code may provide more information


    debug1: Unspecified GSS failure. Minor code may provide more information
    Cannot determine realm for numeric host address

    debug1: Next authentication method: publickey
    debug1: Trying private key: /home/szyl/.ssh/identity
    debug1: Trying private key: /home/szyl/.ssh/id_rsa
    debug1: Trying private key: /home/szyl/.ssh/id_dsa
    debug1: Next authentication method: password

    发现一直卡在gssapi-with-mic这步,解决方法:

    打开(远程服务器) /etc/ssh/sshd_config(注意是文件 /etc/ssh/sshd_config 而不是/etc/ssh/ssh_config),

    1、把里面的 GSSAPIAuthentication yes 改成 no;

    2、把里面的UseDNS yes 改成 no;

    3、/etc/init.d/sshd restart 重启sshd进程使配置生效。

     netstat -a | more 看有没正常启动,如果出现: 

     tcp   0      0 *:ssh         *:*         LISTEN 

     就说明正常启动了。

     大功告成!处理前后建立 ssh 连接时间的对比:

    $ time xxx@x.x.x.x

    real 0m53.129s
    user 0m0.005s
    sys 0m0.007s

    $ time xxx@x.x.x.x

    real 0m1.122s
    user 0m0.005s
    sys 0m0.004s

    so fast!如没能解决你的问题,请参照这篇:http://linux.chinaunix.net/techdoc/net/2008/08/06/1023398.shtml

  • 相关阅读:
    tomcat配置虚拟主机
    android widget 开发实例 : 桌面便签程序的实现具体解释和源代码 (上)
    Delphi 2007体验!
    ACE定时器
    Unity--关于优化方面的那些事儿(一)
    LTP介绍
    Java正則表達式入门
    Spring整合Hibernate的步骤
    ThreadPool.QueueUserWorkItem的性能问题
    用Bootstrap 写了个站点
  • 原文地址:https://www.cnblogs.com/arccosxy/p/4942027.html
Copyright © 2011-2022 走看看