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
最新文章
- 237. Delete Node in a Linked List
- 两张图总结 Neutron 架构 - 每天5分钟玩转 OpenStack(74)
- 2014 Super Training #4 B Problem Arrangement --状压DP
- volicity语法学习和总结
- android组件间共享数据的常用方法
- Android ServiceConnection
- perl 导出函数到当前名字空间
- 静态与动态IP设置
- JQuery阻止表单提交的方法总结 - 使用onsubmit()验证表单并阻止非法提交
- VS2010使用DX报错 VS报错之混合模式程序集是针对“v1.1.4322”版的运行时生成的,在没有配置其他信息的情况下,无法在 4.0 运行时中加载该程序集。
- linux 的 ping 原理
- springboot中logback配置
- Java jvisualvm 远程监控tomcatt
- Docker Registry V2 Garbage Collection
- python3用BeautifulSoup抓取a标签
- MiZ702学习笔记9——XADC采集片上数据PS版
- 使用Java对文件进行解压缩
- 《linux内核与分析》第三周
- list元素排序需要满足两个条件
- 11 jsp脚本调用java代码
热门文章
- 回顾2018年最受欢迎的十四款NoSQL产品
- Promise.then的第二个参数与catch的区别
- 为Docker容器设置http代理
- httpclient检查某个链接是否可用
- [svc]证书各个字段的含义
- 脚本加密http://www.datsi.fi.upm.es/~frosal/sources/
- CodeCombat编程游戏
- hdoj:2027
- 【转】在Win7的IIS上搭建FTP服务及用户授权
- 字节顺序:高位优先(big-endian)和低位优先(little-endian)