• 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

  • 相关阅读:
    零基础学习java------day4------流程控制结构
    零基础学习java------day3-运算符 以及eclipse的使用
    [Codeforces Round #195 (Div. 2)] A. Vasily the Bear and Triangle
    [POJ] 1011 Sticks
    [Ioi2007]Miners 矿工配餐(BZOJ1806)
    [LA] 2031 Dance Dance Revolution
    [TYVJ] P1023 奶牛的锻炼
    ACM训练计划step 2 [非原创]
    ACM训练计划step 1 [非原创]
    [POJ] 1797 Heavy Transportation
  • 原文地址:https://www.cnblogs.com/arccosxy/p/4942027.html
Copyright © 2020-2023  润新知