<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>https://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>https://jackxiang.com/post//</link>
<title><![CDATA[linux ssh连接主机慢的解决方法]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Mon, 08 Feb 2010 11:00:03 +0000</pubDate> 
<guid>https://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	为何慢：<br/>可以用ssh的详细模式跟踪（ssh -v x.x.x.x)一下，是不是DNS反解析？<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp; 这个问题正是最后面那项 GSSAPIAuthentication 引起的,打开这个ssh的时候可能会先去尝试其他的认证方式.很多地方都会介绍说修改 /etc/ssh/ssh_config 文件,但是其实这并不是最好的办法,因为在下次升级的时候,也许会因为配置文件被修改过,而引起不必要的麻烦.我的解决办法是修改个人用户的配置文件,如下:<br/>echo “GSSAPIAuthentication no” &gt;&gt; ~/.ssh/config<br/><br/>1）修改：/etc/ssh/ssh_config 文件:GSSAPIAuthentication no ，UseDNS no。&nbsp;&nbsp;vi /etc/ssh/sshd_config&nbsp;&nbsp;，别少了个D。<br/><br/>2）也可以修改:~/.ssh/config :GSSAPIAuthentication no ,echo “GSSAPIAuthentication no” &gt;&gt; ~/.ssh/config<br/><br/><br/><br/>今天在各个主机上同步一个snmpd.conf文件时候,发现所有主机都是通过ssh连接到同一台主机上,有的很快连接上了,有的一直处于等待之中.这样就导致集中操作时候出现部分主机操作失败.后来通过分析发现主要是卡在了DNS解析时候.<br/><div class="code"><br/>&#91;root@watchserver ~&#93;# cat /etc/resolv.conf<br/>nameserver 127.0.0.1<br/>&#91;root@watchserver ~&#93;# nslookup<br/>&gt; 192.16.1.2<br/>;; connection timed out; no servers could be reached<br/>&gt;server 202.106.0.20<br/>Default server: 202.106.0.20<br/>Address: 202.106.0.20#53<br/>&gt; 192.16.1.2<br/>Server:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;202.106.0.20<br/>Address:&nbsp;&nbsp;&nbsp;&nbsp;202.106.0.20#53<br/>217.1.168.192.in-addr.arpa&nbsp;&nbsp;&nbsp;&nbsp;name = localhost.<br/>&gt;<br/></div><br/>一般情况就是无法解析的时候要一值等到time out才能出现,所以解决方法就是有/etc/resolv.conf中加入正确的dns地址,或者是在/etc/hosts中做好映射.当然还有其他情况也会造成这个问题出现,大致需要注意的地方如下:<br/>1、修改/etc/ssh/sshd_config文件中UseDNS=no<br/>2、修改/etc/nsswitch.conf文件中hosts：files<br/>3、修改/etc/ssh/sshd_config文件中GSSAPIAuthentication no<br/><br/><br/>可以用ssh的详细模式跟踪（ssh -v x.x.x.x)一下，发现主要问题出在GSS认证和DNS解析上：<br/>[xiangdong@localhost ~]$ ssh -v -l xiangdong 192.168.109.108<br/>OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008<br/>debug1: Reading configuration data /etc/ssh/ssh_config<br/>debug1: Applying options for *<br/>debug1: Connecting to 192.168.109.108 [192.168.109.108] port 22.<br/>debug1: Connection established.<br/>debug1: identity file /home/xiangdong/.ssh/identity type -1<br/>debug1: identity file /home/xiangdong/.ssh/id_rsa type -1<br/>debug1: identity file /home/xiangdong/.ssh/id_dsa type -1<br/>debug1: loaded 3 keys<br/>debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3<br/>debug1: match: OpenSSH_4.3 pat OpenSSH*<br/>debug1: Enabling compatibility mode for protocol 2.0<br/>debug1: Local version string SSH-2.0-OpenSSH_4.3<br/>debug1: SSH2_MSG_KEXINIT sent<br/>debug1: SSH2_MSG_KEXINIT received<br/>debug1: kex: server-&gt;client aes128-cbc hmac-md5 none<br/>debug1: kex: client-&gt;server aes128-cbc hmac-md5 none<br/><br/>&nbsp;&nbsp;针对分析的结果，我们修改/etc/ssh/sshd_config 文件，设置GSSAPIAuthentication no ，同时设置 UseDNS no，最后保存修改，重启sshd服务再连接这个问题就可以解决了。
]]>
</description>
</item><item>
<link>https://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] linux ssh连接主机慢的解决方法]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>https://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>