<?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>Shadow &#38; Honnix &#187; ssh</title>
	<atom:link href="http://honnix.com/blog/archives/tag/ssh/feed" rel="self" type="application/rss+xml" />
	<link>http://honnix.com/blog</link>
	<description>she&#039;s growing up</description>
	<lastBuildDate>Sun, 15 Jan 2012 10:44:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>很久没更新了，说说翻墙的事儿吧</title>
		<link>http://honnix.com/blog/archives/575</link>
		<comments>http://honnix.com/blog/archives/575#comments</comments>
		<pubDate>Tue, 01 Jun 2010 14:44:11 +0000</pubDate>
		<dc:creator>honnix</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[anti-idle]]></category>
		<category><![CDATA[expect]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[翻墙]]></category>

		<guid isPermaLink="false">http://honnix.com/blog/?p=575</guid>
		<description><![CDATA[买了个ssh，淘宝上到处都是，就不说具体哪家了。价格还可以，一个月3块，先来了一个月尝尝。 速度还行，就是有一点比较讨厌，没法保持连接，一段时间idle之后就被断开了，尝试设了一些参数，还是不行，还是写个脚本来干。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 #!/usr/bin/expect -f &#160; set timeout 30 spawn ssh wall match_max 100000 expect -re &#34;.*password:.*&#34; send -- &#34;xxxxxx\r&#34; send -- &#34;\r\r\r\r&#34; expect timeout &#160; for &#123;&#125; 1 &#123;&#125; &#123; send &#34;ls\r&#34; expect timeout &#125; &#160; exit 0 其实很简单，就是登录之后每隔30秒就ls一下。估计这样就行了。]]></description>
			<content:encoded><![CDATA[<p>买了个ssh，淘宝上到处都是，就不说具体哪家了。价格还可以，一个月3块，先来了一个月尝尝。<br />
速度还行，就是有一点比较讨厌，没法保持连接，一段时间idle之后就被断开了，尝试设了一些参数，还是不行，还是写个脚本来干。</p>

<div class="wp_codebox"><table><tr id="p5752"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code" id="p575code2"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/expect -f</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">set</span> timeout <span style="color: #000000;">30</span>
spawn <span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #c20cb9; font-weight: bold;">wall</span>
match_max <span style="color: #000000;">100000</span>
expect <span style="color: #660033;">-re</span> <span style="color: #ff0000;">&quot;.*password:.*&quot;</span>
send <span style="color: #660033;">--</span> <span style="color: #ff0000;">&quot;xxxxxx<span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
send <span style="color: #660033;">--</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
expect timeout
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    send <span style="color: #ff0000;">&quot;ls<span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>
    expect timeout
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></td></tr></table></div>

<p>其实很简单，就是登录之后每隔30秒就ls一下。估计这样就行了。</p>
]]></content:encoded>
			<wfw:commentRss>http://honnix.com/blog/archives/575/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

