<?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>Tue, 10 Aug 2010 23:41:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.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 />

	<h4>相关日志</h4>
	<ul class="st-related-posts">
	<li><a href="http://rainux.org/%e8%a7%81%e5%88%b0-debian-gnulinux-%e5%88%9b%e5%a7%8b%e4%ba%ba-ian-murdock-%e4%ba%86" title="见到 Debian GNU/Linux 创始人 Ian Murdock 了 (October 22, 2007)">见到 Debian GNU/Linux 创始人 Ian Murdock 了</a> (4)</li>
	<li><a href="http://rainux.org/vim-gvimvim-on-win32" title="正确设置 Vim 的字符编码选项 (gVim/Vim on Win32 中文环境) (October 20, 2005)">正确设置 Vim 的字符编码选项 (gVim/Vim on Win32 中文环境)</a> (9)</li>
	<li><a href="http://rainux.org/openssh-public-key-authentication-guide-automatic-login" title="基于公钥认证方式的 OpenSSH Server 自动登录完全手册（Linux/Windows 下的 SSH 自动登录指南） (September 2, 2008)">基于公钥认证方式的 OpenSSH Server 自动登录完全手册（Linux/Windows 下的 SSH 自动登录指南）</a> (0)</li>
	<li><a href="http://rainux.org/install-flash-plugin-for-iceweasel-firefox-on-debian-lenny-amd64" title="在 Debian lenny amd64 里安装 Iceweasel/Firefox 的 Flash 播放器插件 (June 4, 2008)">在 Debian lenny amd64 里安装 Iceweasel/Firefox 的 Flash 播放器插件</a> (2)</li>
	<li><a href="http://rainux.org/%e5%9b%9e%e5%88%b0-vim%ef%bc%8c%e5%9b%9e%e5%88%b0-gnulinux" title="回到 Vim，回到 GNU/Linux (March 9, 2005)">回到 Vim，回到 GNU/Linux</a> (2)</li>
</ul>

]]></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>5</slash:comments>
		</item>
	</channel>
</rss>
