<?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>RootBSD blog &#187; ssh</title>
	<atom:link href="http://www.rootbsd.net/blog/category/ssh/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rootbsd.net/blog</link>
	<description>Our FreeBSD Hosting Discussion</description>
	<lastBuildDate>Wed, 16 Jun 2010 21:37:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SSH session timeout</title>
		<link>http://www.rootbsd.net/blog/2008/ssh-session-timeout/</link>
		<comments>http://www.rootbsd.net/blog/2008/ssh-session-timeout/#comments</comments>
		<pubDate>Tue, 19 Feb 2008 01:37:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[freebsd jails]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.rootbsd.net/blog/freebsd-jails/ssh-session-timeout/</guid>
		<description><![CDATA[Have you ever noticed that on some Internet connections, ssh sessions will drop for no reason other than a lack of activity?  I have noticed this when using ssh from some open access points and friends houses.   The reason isn&#8217;t a poor internet connection but actually a poor router.  Most home/office [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever noticed that on some Internet connections, ssh sessions will drop for no reason other than a lack of activity?  I have noticed this when using ssh from some open access points and friends houses.   The reason isn&#8217;t a poor internet connection but actually a poor router.  Most home/office routers perform <a href="http://www.cisco.com/en/US/tech/tk648/tk361/tk438/tsd_technology_support_sub-protocol_home.html">NAT</a> to connect users on a private network to the public Internet.  The router must keep table open of what connections are active, connecting local IP addresses to remote servers.  The problem is that if a TCP session (such as ssh) doesn&#8217;t send data after awhile, the router will think it timed out and remove it from its NAT connections table.  This results in a dropped ssh connection.</p>
<p>To workaround this, you can setup a keepalive on your ssh connection.  The keepalive will send a heartbeat check between the client and server, so the session stays active and doesn&#8217;t look dormant.  You can configure this in the Windows client, putty, or you can configure it in opensshd on your <a href="http://www.rootbsd.net">FreeBSD vps</a>.</p>
<p>To set this up, edit /etc/ssh/sshd_config on your VPS or server and add:</p>
<blockquote><p>ClientAliveInterval 300<br />
ClientAliveCountMax 3</p></blockquote>
<p>This will have sshd send a heartbeat every 5 minutes (300 seconds) and allow for up to 3 missed heartbeat responses before considering the session dead.</p>
<p>You must then restart sshd to apply the settings:</p>
<blockquote><p>/etc/rc.d/sshd restart</p></blockquote>
<p>Cheers</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rootbsd.net/blog/2008/ssh-session-timeout/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
