ssh连接慢

来源:互联网 发布:淘宝详情图尺寸 编辑:程序博客网 时间:2024/04/20 03:06

最近在公司集群上部署各种应用,有时候ssh连接过程慢的蛋疼。为了在console里追求像格斗游戏般敲击键盘的打击快感,我特意研究了一下怎么解决ssh连接慢的问题。

首先,使用下列命令进入ssh调试模式:

# ssh -v 192.168.0.108

查看打印信息卡在哪里。
我遇到了下面几个情况:
1. 卡在GSSAPIAuthentication

debug1: An invalid name was supplied
Cannot determine realm for numeric host address

或者出现这种情况:

Next authentication method: …

处理办法是,在本机上修改/etc/ssh/ssh_config:

GSSAPIAuthentication no


  1. 卡在DNS

debug1: SSH2_MSG_SERVICE_ACCEPT recieved

Authentication that can continue: publickey,…
在本机和目标机上修改/etc/ssh/sshd_config:
UseDNS no

然后在本机和目标机上重启ssh服务

service sshd restart
1 0
原创粉丝点击