<?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>sshd &#8211; Luxing Huang</title>
	<atom:link href="https://luxing.im/tag/sshd/feed/" rel="self" type="application/rss+xml" />
	<link>https://luxing.im</link>
	<description>Thoughs and things</description>
	<lastBuildDate>Sat, 02 Jul 2016 20:46:44 +0000</lastBuildDate>
	<language>en-CA</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
<site xmlns="com-wordpress:feed-additions:1">58771605</site>	<item>
		<title>OpenSSH hang after SSH2_MSG_SERVICE_ACCEPT</title>
		<link>https://luxing.im/openssh-hang-after-ssh2_msg_service_accept/</link>
					<comments>https://luxing.im/openssh-hang-after-ssh2_msg_service_accept/#respond</comments>
		
		<dc:creator><![CDATA[Luxing Huang]]></dc:creator>
		<pubDate>Sat, 02 Jul 2016 20:46:44 +0000</pubDate>
				<category><![CDATA[Techie Stuff]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sshd]]></category>
		<guid isPermaLink="false">https://luxing.im/?p=672</guid>

					<description><![CDATA[One of my servers back in China has a really sloooow connection to some of the famous DNS servers, like Google&#8217;s or OpenDNS. I happen to come across a performance issue related to DNS issue when I was logging into that server. Turned on debug -v, I can see where it hangs: debug1: Enabling compatibility &#8230; <p class="link-more"><a href="https://luxing.im/openssh-hang-after-ssh2_msg_service_accept/" class="more-link">Continue reading<span class="screen-reader-text"> "OpenSSH hang after SSH2_MSG_SERVICE_ACCEPT"</span></a></p>]]></description>
										<content:encoded><![CDATA[<p>One of my servers back in China has a really sloooow connection to some of the famous DNS servers, like Google&#8217;s or OpenDNS. I happen to come across a performance issue related to DNS issue when I was logging into that server.<br />
<span id="more-672"></span></p>
<p>Turned on debug -v, I can see where it hangs:</p>
<pre>
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
debug1: match: OpenSSH_6.6.1 pat OpenSSH_6.6.1* compat 0x04000000
debug1: Authenticating to slow.example.com:22 as 'root'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: curve25519-sha256@libssh.org need=64 dh_need=64
debug1: kex: curve25519-sha256@libssh.org need=64 dh_need=64
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:x0K6+PUKJzPg3V6PQXThdNXE2C9YJ4EeN+2CmLSWbqk
debug1: Host 'slow.example.com' is known and matches the ECDSA host key.
debug1: Found key in /home/user/.ssh/known_hosts:100
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_ACCEPT received
</pre>
<p>Then it stopped for a very looong time.</p>
<p>The solution is not to look up DNS for sshd when receiving requests. In /etc/ssh/sshd_config, add a value called </p>
<pre>UseDNS no</pre>
<p> and restart the server. Next time when you login, it&#8217;ll be much faster.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://luxing.im/openssh-hang-after-ssh2_msg_service_accept/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">672</post-id>	</item>
	</channel>
</rss>
