<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rainux's Journal &#187; ssh Archives  &laquo; Rainux&#039;s Journal</title>
	<atom:link href="http://rainux.org/tag/ssh/feed/" rel="self" type="application/rss+xml" />
	<link>http://rainux.org</link>
	<description>Rubyist of Vimmer</description>
	<lastBuildDate>Sat, 23 Jul 2011 12:09:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>解决 ssh 创建连接极慢的问题</title>
		<link>http://rainux.org/%e8%a7%a3%e5%86%b3-ssh-%e5%88%9b%e5%bb%ba%e8%bf%9e%e6%8e%a5%e6%9e%81%e6%85%a2%e7%9a%84%e9%97%ae%e9%a2%98</link>
		<comments>http://rainux.org/%e8%a7%a3%e5%86%b3-ssh-%e5%88%9b%e5%bb%ba%e8%bf%9e%e6%8e%a5%e6%9e%81%e6%85%a2%e7%9a%84%e9%97%ae%e9%a2%98#comments</comments>
		<pubDate>Wed, 18 Jun 2008 14:08:56 +0000</pubDate>
		<dc:creator>Rainux</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Software 软件]]></category>
		<category><![CDATA[Software_软件]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.rainux.org/2008/06/18/229</guid>
		<description><![CDATA[做 Web 开发的工作经常需要 ssh 或者 scp 连接一堆远程主机，同样是 Linux 主机，其中一些创建 ssh 连接速度特别慢，连接建立之后执行操作速度却很正常，看来应该不是网络原因。 Google 了一下，这位老兄也遇到类似的问题，看完他描述的问题才知道可以用 ssh -v 来查看详细的连接建立过程，马上用一台建立连接很慢的主机试了一下，在一大堆输出信息中发现在这里停留最久: 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 No credentials cache found debug1: Unspecified GSS failure. Minor code may provide more information No credentials cache found [...]]]></description>
			<content:encoded><![CDATA[<p>做 Web 开发的工作经常需要 ssh 或者 scp 连接一堆远程主机，同样是 Linux 主机，其中一些创建 ssh 连接速度特别慢，连接建立之后执行操作速度却很正常，看来应该不是网络原因。</p>

<p>Google 了一下，<a href="http://www.beowulf.org/archive/2002-August/007894.html">这位老兄</a>也遇到类似的问题，看完他描述的问题才知道可以用 ssh -v 来查看详细的连接建立过程，马上用一台建立连接很慢的主机试了一下，在一大堆输出信息中发现在这里停留最久:</p>

<pre><code>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
No credentials cache found

debug1: Unspecified GSS failure.  Minor code may provide more information
No credentials cache found

debug1: Unspecified GSS failure.  Minor code may provide more information


debug1: Next authentication method: publickey
</code></pre>

<p>原来是因为尝试了个没有意义而且会失败的 gssapi-with-mic 认证方式浪费了时间，打开 /etc/ssh/ssh_config 把里面的 GSSAPIAuthentication yes 改成 no 关掉它，即可让 ssh 直接尝试美妙的 publickey 认证方式。</p>

<p>禁用 GSSAPIAuthentication 前后建立 ssh 连接时间的对比:</p>

<pre name="code" class="bash">rainux@mutalisk:~$ time ssh root@i-will-not-tell-you.com exit

real    0m18.488s
user    0m0.004s
sys     0m0.008s
rainux@mutalisk:~$ time ssh root@i-will-not-tell-you.com exit

real    0m3.531s
user    0m0.016s
sys     0m0.000s
</pre>

	标签：<a href="http://rainux.org/tag/gnu-linux/" title="GNU/Linux" rel="tag">GNU/Linux</a>, <a href="http://rainux.org/tag/software_%e8%bd%af%e4%bb%b6/" title="Software_软件" rel="tag">Software_软件</a>, <a href="http://rainux.org/tag/ssh/" title="ssh" rel="tag">ssh</a><br />
]]></content:encoded>
			<wfw:commentRss>http://rainux.org/%e8%a7%a3%e5%86%b3-ssh-%e5%88%9b%e5%bb%ba%e8%bf%9e%e6%8e%a5%e6%9e%81%e6%85%a2%e7%9a%84%e9%97%ae%e9%a2%98/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

