首页 技术 正文
技术 2022年11月12日
0 收藏 720 点赞 3,578 浏览 1285 个字

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

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,491
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,906
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,739
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,492
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,131
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,293