<?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>深度VPS &#187; 连接时间</title>
	<atom:link href="http://www.deepvps.com/tag/%E8%BF%9E%E6%8E%A5%E6%97%B6%E9%97%B4/feed" rel="self" type="application/rss+xml" />
	<link>http://www.deepvps.com</link>
	<description>专注VPS技术，关注前端技术</description>
	<lastBuildDate>Sat, 04 Feb 2023 14:00:33 +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>Linux VPS延长SSH连接时间设置</title>
		<link>http://www.deepvps.com/linux-vps-ssh-clientalivecountmax.html</link>
		<comments>http://www.deepvps.com/linux-vps-ssh-clientalivecountmax.html#comments</comments>
		<pubDate>Sat, 24 Mar 2012 07:13:54 +0000</pubDate>
		<dc:creator>deepvps</dc:creator>
				<category><![CDATA[VPS管理维护]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[延长]]></category>
		<category><![CDATA[连接时间]]></category>

		<guid isPermaLink="false">http://www.deepvps.com/?p=1074</guid>
		<description><![CDATA[最近新测试一个VPS，但是连接SSH刚刚离开一会就断开，不得不需要反复连接服务器，为了使SSH服务器可以保持足够的连接时间，大家可以按以下方法设置:
基于安全的理由，如果用户连线到 SSH Server 后闲置，SSH Server 会在超过特定时间后自动终止 SSH 连线。以下是设定终止连线时间的方法:
1、打开 /etc/ssh/sshd_config 文件，找到2个参数ClientAliveInterval和 ClientAliveCountMax。
# 打开
vi /etc/ssh/sshd_config
# 修改 
ClientAliveInterval 30
ClientAliveCountMax 6

2、如果这2行最前面有#号，将那个#号删除，并修改想要的数值。
ClientAliveInterval表示每隔多少秒，服务器端向客户端发送心跳，是的，你没看错。
下面的ClientAliveInterval表示上述多少次心跳无响应之后，会认为Client已经断开。
所以，总共允许无响应的时间是60*3=180秒。
3、修改后保存并关闭文件，重新启动 sshd:
/etc/rc.d/init.d/sshd restart
]]></description>
			<content:encoded><![CDATA[<p>最近新测试一个VPS，但是连接SSH刚刚离开一会就断开，不得不需要反复连接服务器，为了使SSH服务器可以保持足够的连接时间，大家可以按以下方法设置:</p>
<p>基于安全的理由，如果用户连线到 SSH Server 后闲置，SSH Server 会在超过特定时间后自动终止 SSH 连线。以下是设定终止连线时间的方法:</p>
<p>1、打开 /etc/ssh/sshd_config 文件，找到2个参数ClientAliveInterval和 ClientAliveCountMax。</p>
<p><span style="color: #008000;"># 打开</span></p>
<blockquote><p>vi /etc/ssh/sshd_config</p></blockquote>
<p><span style="color: #008000;"># 修改 </span></p>
<blockquote><p>ClientAliveInterval 30<br />
ClientAliveCountMax 6</p></blockquote>
<p><span id="more-1074"></span></p>
<p>2、如果这2行最前面有#号，将那个#号删除，并修改想要的数值。</p>
<p>ClientAliveInterval表示每隔多少秒，服务器端向客户端发送心跳，是的，你没看错。</p>
<p>下面的ClientAliveInterval表示上述多少次心跳无响应之后，会认为Client已经断开。</p>
<p>所以，总共允许无响应的时间是60*3=180秒。</p>
<p>3、修改后保存并关闭文件，重新启动 sshd:</p>
<p>/etc/rc.d/init.d/sshd restart</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deepvps.com/linux-vps-ssh-clientalivecountmax.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
