这两天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

最新文章

  1. 237. Delete Node in a Linked List
  2. 两张图总结 Neutron 架构 - 每天5分钟玩转 OpenStack(74)
  3. 2014 Super Training #4 B Problem Arrangement --状压DP
  4. volicity语法学习和总结
  5. android组件间共享数据的常用方法
  6. Android ServiceConnection
  7. perl 导出函数到当前名字空间
  8. 静态与动态IP设置
  9. JQuery阻止表单提交的方法总结 - 使用onsubmit()验证表单并阻止非法提交
  10. VS2010使用DX报错 VS报错之混合模式程序集是针对“v1.1.4322”版的运行时生成的,在没有配置其他信息的情况下,无法在 4.0 运行时中加载该程序集。
  11. linux 的 ping 原理
  12. springboot中logback配置
  13. Java jvisualvm 远程监控tomcatt
  14. Docker Registry V2 Garbage Collection
  15. python3用BeautifulSoup抓取a标签
  16. MiZ702学习笔记9——XADC采集片上数据PS版
  17. 使用Java对文件进行解压缩
  18. 《linux内核与分析》第三周
  19. list元素排序需要满足两个条件
  20. 11 jsp脚本调用java代码

热门文章

  1. 回顾2018年最受欢迎的十四款NoSQL产品
  2. Promise.then的第二个参数与catch的区别
  3. 为Docker容器设置http代理
  4. httpclient检查某个链接是否可用
  5. [svc]证书各个字段的含义
  6. 脚本加密http://www.datsi.fi.upm.es/~frosal/sources/
  7. CodeCombat编程游戏
  8. hdoj:2027
  9. 【转】在Win7的IIS上搭建FTP服务及用户授权
  10. 字节顺序:高位优先(big-endian)和低位优先(little-endian)