<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[刘新修]]></title> 
<link>http://pic1.liuxinxiu.com:80/index.php</link> 
<description><![CDATA[刘新修的个人博客 (Liuxinxiu'S Blog)]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[刘新修]]></copyright>
<item>
<link>http://pic1.liuxinxiu.com:80/ssh_timeout/</link>
<title><![CDATA[ssh超时断开的解决方法]]></title> 
<author>刘新修 &lt;admin@yourname.com&gt;</author>
<category><![CDATA[Linux/Unix]]></category>
<pubDate>Sat, 17 May 2014 06:23:07 +0000</pubDate> 
<guid>http://pic1.liuxinxiu.com:80/ssh_timeout/</guid> 
<description>
<![CDATA[ 
	<p><span style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: small; line-height: 25.200000762939453px;">当用SSH Secure Shell连接Linux时，如果几分钟没有任何操作，连接就会断开。必须重新登陆才行，每次都重复相同的操作，很是烦人，一般修改两个地方可将这烦人的问题解决</span></p><p><span style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: small; line-height: 25.200000762939453px;">1、echo $TMOUT （先查看有预设，如果大于0就把它设置为0 &nbsp; &nbsp; &nbsp;</span><span style="color: rgb(51, 51, 51); font-family: Verdana, Arial, Tahoma; line-height: 25px;">TMOUT=0</span><span style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: small; line-height: 25.200000762939453px;">）</span></p><p>不重启机器让<span style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: small; line-height: 25.200000762939453px;">/etc/profile文件生效！ . </span><span style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: small; line-height: 25.200000762939453px;">/etc/profile</span></p><p><span style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: small; line-height: 25.200000762939453px;"> 如果显示空白,表示没有设置, 等于使用默认值0, 一般情况下应该是不超时. 如果大于0, 可以在如/etc/profile之类文件中设置它为0.</span></p><p style="margin-bottom: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.200000762939453px;"><span style="font-size: small;">2、修改/etc/ssh/sshd_config文件，将ClientAliveInterval 0和ClientAliveCountMax 3的注释符号去掉,将ClientAliveInterval对应的0改成60,ClientAliveInterval指定了服务器端向客户端请求消息的时间间隔, 默认是0, 不发送.而ClientAliveInterval 60表示每分钟发送一次, 然后客户端响应, 这样就保持长连接了.ClientAliveCountMax, 使用默认值3即可.ClientAliveCountMax表示服务器发出请求后客户端没有响应的次数达到一定值, 就自动断开. 正常情况下, 客户端不会不响应.<br /></span></p><p style="margin-bottom: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.200000762939453px;"><span style="font-size: small;">#ClientAliveInterval 0</span></p><p style="margin-bottom: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.200000762939453px;"><span style="font-size: small;">#ClientAliveCountMax 3</span></p><p style="margin-bottom: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.200000762939453px;">***************************************</p><p style="margin-bottom: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.200000762939453px;">去掉注释，设置为60秒发送一次</p><p style="margin-bottom: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.200000762939453px;"><span style="color: rgb(255, 0, 0);"><strong><span style="font-size: small;">ClientAliveInterval 60</span></strong></span></p><p style="margin-bottom: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.200000762939453px;"><span style="color: rgb(255, 0, 0);"><strong><span style="font-size: small;">ClientAliveCountMax 3</span></strong></span></p><p style="margin-bottom: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.200000762939453px;">重启SSHD</p><p style="margin-bottom: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.200000762939453px;">service sshd restart</p>
]]>
</description>
</item><item>
<link>http://pic1.liuxinxiu.com:80/ssh_timeout/#blogcomment</link>
<title><![CDATA[[评论] ssh超时断开的解决方法]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://pic1.liuxinxiu.com:80/ssh_timeout/#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>