﻿<?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>Timothy&#039;s Space &#187; Linux</title>
	<atom:link href="http://www.xiaozhou.net/tag/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://www.xiaozhou.net</link>
	<description>君看一叶舟，出没风波里</description>
	<lastBuildDate>Tue, 07 Feb 2012 04:28:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Debian VPS 设置中文显示</title>
		<link>http://www.xiaozhou.net/ittech/vps-ittech/display_chinese_in_debian_vps-2011-08-14.htm</link>
		<comments>http://www.xiaozhou.net/ittech/vps-ittech/display_chinese_in_debian_vps-2011-08-14.htm#comments</comments>
		<pubDate>Sun, 14 Aug 2011 13:59:00 +0000</pubDate>
		<dc:creator>Timothy</dc:creator>
				<category><![CDATA[vps]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[显示]]></category>

		<guid isPermaLink="false">http://www.xiaozhou.net/ittech/vps-ittech/debian-vps-%e8%ae%be%e7%bd%ae%e4%b8%ad%e6%96%87%e6%98%be%e7%a4%ba-2011-08-14.htm</guid>
		<description><![CDATA[最近看到YuchBerry出了新版，于是又打算把我的BB9000拿来折腾一下。不过第一步呢，就是需要在VPS上搭建YuchBerry的服务端，由于推送和发送的邮件中会用到中文，所以需要先给VPS设置中文环境，避免出现乱码。本教程将记录一下如何在Linux VPS中设置中文字体和显示中文，VPS的系统为Debian。 首先，安装中文包： ?View Code BASH1 apt-get install zhcon 然后，查看系统支持的字库有哪些：more /usr/share/i18n/SUPPORTED step 1:  编辑 /etc/locale.gen 添加如下内容，使系统中加入中文库 #koria add this for chinese input zh_CN.UTF-8 UTF-8 step2: 执行脚本/usr/sbin/locale-gen，生成具有中文输入库的支持包 /usr/sbin/locale-gen step3 :  编辑 /etc/bashrc 和 /etc/profile，在文件的最后加上 export LC_ALL=&#8221;zh_CN.utf8&#8243; export LC_CTYPE=&#8221;zh_CN.utf8&#8243; export LANG=&#8221;zh_CN.utf8&#8243; 最后，设置SSH客户端的字体和编码，例如SecureCRT 中 Session Options 里头字符设置为 UTF-8，并选择 Fixedsys 字体。重新用 SecureCRT 连接。 最后，测试中文能否正常显示，用date命令： 声明: 此Blog中的文章和随笔仅代表作者在某一特定时间内的观点和结论，对其完全的正确不做任何担保或假设 本站文章均采用 知识共享署名-相同方式共享3.0 协议进行授权，除非注明，本站文章均为原创，转载请注明转自 [...]]]></description>
			<content:encoded><![CDATA[<p>最近看到YuchBerry出了新版，于是又打算把我的BB9000拿来折腾一下。不过第一步呢，就是需要在VPS上搭建YuchBerry的服务端，由于推送和发送的邮件中会用到中文，所以需要先给VPS设置中文环境，避免出现乱码。本教程将记录一下如何在Linux VPS中设置中文字体和显示中文，VPS的系统为Debian。<span id="more-1254"></span></p>
<p>首先，安装中文包：</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1254code2'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p12542"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1254code2"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> zhcon</pre></td></tr></table></div>

<p>然后，查看系统支持的字库有哪些：more /usr/share/i18n/SUPPORTED</p>
<p>step 1:  编辑 /etc/locale.gen 添加如下内容，使系统中加入中文库</p>
<p>#koria add this for chinese input</p>
<p>zh_CN.UTF-8 UTF-8</p>
<p>step2: 执行脚本/usr/sbin/locale-gen，生成具有中文输入库的支持包</p>
<p>/usr/sbin/locale-gen</p>
<p>step3 :  编辑 /etc/bashrc 和 /etc/profile，在文件的最后加上</p>
<p>export LC_ALL=&#8221;zh_CN.utf8&#8243;</p>
<p>export LC_CTYPE=&#8221;zh_CN.utf8&#8243;</p>
<p>export LANG=&#8221;zh_CN.utf8&#8243;</p>
<p>最后，设置SSH客户端的字体和编码，例如SecureCRT 中 Session Options 里头字符设置为 UTF-8，并选择 Fixedsys 字体。重新用 SecureCRT 连接。</p>
<p>最后，测试中文能否正常显示，用date命令：</p>
<p><a href="http://www.xiaozhou.net/pics/Debian_1330B/chinese.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border: 0px;" title="chinese" src="http://www.xiaozhou.net/pics/Debian_1330B/chinese_thumb.jpg" alt="chinese" width="469" height="90" border="0" /></a></p>
<p class="announce"><span style="font-weight:bold;text-shadow:0 1px 0 #ddd;">声明:</span> 此Blog中的文章和随笔仅代表作者在某一特定时间内的观点和结论，对其完全的正确不做任何担保或假设 <br /> 本站文章均采用 <a rel="nofollow" href="http://creativecommons.org/licenses/by-nc-sa/3.0/" title="署名-非商业性使用-相同方式共享">知识共享署名-相同方式共享3.0</a> 协议进行授权，除非注明，本站文章均为原创，转载请注明转自  <a href="http://www.xiaozhou.net">Timothy&#039;s Space</a> 并应以链接形式标明本文地址!</p>]]></content:encoded>
			<wfw:commentRss>http://www.xiaozhou.net/ittech/vps-ittech/display_chinese_in_debian_vps-2011-08-14.htm/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>自动监控VPS负载并重启Web服务的脚本</title>
		<link>http://www.xiaozhou.net/ittech/vps-ittech/vps_web_service_auto_monitoring_and_restarting-2011-05-14.htm</link>
		<comments>http://www.xiaozhou.net/ittech/vps-ittech/vps_web_service_auto_monitoring_and_restarting-2011-05-14.htm#comments</comments>
		<pubDate>Sat, 14 May 2011 09:00:00 +0000</pubDate>
		<dc:creator>Timothy</dc:creator>
				<category><![CDATA[vps]]></category>
		<category><![CDATA[average]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[load]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[服务]]></category>
		<category><![CDATA[脚本]]></category>
		<category><![CDATA[负载]]></category>

		<guid isPermaLink="false">http://www.xiaozhou.net/ittech/vps-ittech/%e8%87%aa%e5%8a%a8%e7%9b%91%e6%8e%a7vps%e8%b4%9f%e8%bd%bd%e5%b9%b6%e9%87%8d%e5%90%afweb%e6%9c%8d%e5%8a%a1%e7%9a%84%e8%84%9a%e6%9c%ac-2011-05-14.htm</guid>
		<description><![CDATA[VPS其实和一般的独立Linux服务器，在使用上基本没有区别，因为现在的虚拟化技术以及很成熟了，不过VPS和独服还是有一个很大的差异，那就是系统资源和性能上。通常，VPS都是由一个独立服务器划分出来的，所以在资源和性能优势上，远比不上独服。 就拿前段时间本VPS受到的DDOS攻击来说，其实DDOS也是利用大量发起的请求，导致被攻击VPS(或服务器)内存资源被耗尽，系统负载过高，而导致80端口的Http服务无响应，从而达到最终的攻击目的。DDOS虽然防不胜防，不过总还是有一些办法，能把DDOS的影响减小的。比如定时监控系统状态，然后自动重启Web服务，这也是本文要介绍的一种方法。 在VPS被攻击的时候，有一些系统指标能反应出系统是否处于被攻击状态，一个就是查看内存剩余量，当然，这并不是最准确的方法，另外一种，就是查看Linux的系统平均负载值。 Linux系统负载介绍 系统平均负载被定义为在特定时间间隔内运行队列中的平均进程树。如果一个进程满足以下条件则其就会位于运行队列中： - 它没有在等待I/O操作的结果 - 它没有主动进入等待状态(也就是没有调用&#8217;wait&#8217;) - 没有被停止(例如：等待终止) Linux系统中，通过很多命令都可以查看当前的系统平均负载值，比如：w,top或者uptime命令 命令输出的内容表示在过去的1、5、15分钟内运行队列中的平均进程数量。 通常情况下，这些值会根据系统的CPU个数有一些区别，对于单核CPU来说，如果负载值达到了1，表明系统负载已经达到了100%，不过对于双核系统来说，1只表示系统负载值只达到50%左右。 以此类推，在多处理器系统中，负载均值是基于内核的数量决定的。以 100% 负载计算，1.00 表示单个处理器，而 2.00 则说明有两个双处理器，那么 4.00 就说明主机具有四个处理器。 根据系统负载值自动重启Web服务 下面的脚本，以装有Apache服务器的VPS为例，定时判断系统负载值，当达到5时，认为系统已经超负荷运转，这时，脚本会自动重启Apache服务，释放系统资源，以达到让VPS服务器平稳运行的目的。 *注：脚本来自网络，非原创，出处不明，本人做了少许改动 ?View Code BASH1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 [...]]]></description>
			<content:encoded><![CDATA[<p>VPS其实和一般的独立Linux服务器，在使用上基本没有区别，因为现在的虚拟化技术以及很成熟了，不过VPS和独服还是有一个很大的差异，那就是系统资源和性能上。通常，VPS都是由一个独立服务器划分出来的，所以在资源和性能优势上，远比不上独服。</p>
<p>就拿前段时间本VPS受到的DDOS攻击来说，其实DDOS也是利用大量发起的请求，导致被攻击VPS(或服务器)内存资源被耗尽，系统负载过高，而导致80端口的Http服务无响应，从而达到最终的攻击目的。DDOS虽然防不胜防，不过总还是有一些办法，能把DDOS的影响减小的。比如定时监控系统状态，然后自动重启Web服务，这也是本文要介绍的一种方法。<span id="more-1171"></span></p>
<p>在VPS被攻击的时候，有一些系统指标能反应出系统是否处于被攻击状态，一个就是查看内存剩余量，当然，这并不是最准确的方法，另外一种，就是查看Linux的系统平均负载值。</p>
<h4>Linux系统负载介绍</h4>
<p>系统平均负载被定义为在特定时间间隔内运行队列中的平均进程树。如果一个进程满足以下条件则其就会位于运行队列中：<br />
- 它没有在等待I/O操作的结果<br />
- 它没有主动进入等待状态(也就是没有调用&#8217;wait&#8217;)<br />
- 没有被停止(例如：等待终止)</p>
<p>Linux系统中，通过很多命令都可以查看当前的系统平均负载值，比如：w,top或者uptime命令</p>
<p><a href="http://www.xiaozhou.net/pics/Apache_E303/uptime.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border-width: 0px;" title="uptime" src="http://www.xiaozhou.net/pics/Apache_E303/uptime_thumb.jpg" border="0" alt="uptime" width="693" height="40" /></a></p>
<p>命令输出的内容表示在过去的1、5、15分钟内运行队列中的平均进程数量。</p>
<p>通常情况下，这些值会根据系统的CPU个数有一些区别，对于单核CPU来说，如果负载值达到了1，表明系统负载已经达到了100%，不过对于双核系统来说，1只表示系统负载值只达到50%左右。</p>
<p>以此类推，在多处理器系统中，负载均值是基于内核的数量决定的。以 100% 负载计算，1.00 表示单个处理器，而 2.00 则说明有两个双处理器，那么 4.00 就说明主机具有四个处理器。</p>
<h4>根据系统负载值自动重启Web服务</h4>
<p>下面的脚本，以装有Apache服务器的VPS为例，定时判断系统负载值，当达到5时，认为系统已经超负荷运转，这时，脚本会自动重启Apache服务，释放系统资源，以达到让VPS服务器平稳运行的目的。</p>
<p><strong><span style="color: #ff0000;">*注：脚本来自网络，非原创，出处不明，本人做了少许改动</span></strong></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1171code4'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p11714"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
</pre></td><td class="code" id="p1171code4"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #666666; font-style: italic;">#usage: */2 * * * * root /root/checkload.sh &gt;&gt;/root/checkload.log</span>
&nbsp;
<span style="color: #007800;">TOP_SYS_LOAD_NUM</span>=<span style="color: #000000;">5</span>
<span style="color: #007800;">SYS_LOAD_NUM</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">uptime</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $(NF-2)}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/,//'</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #ff0000;">&quot;%y-%m-%d&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">uptime</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$TOP_SYS_LOAD_NUM</span> &lt; <span style="color: #007800;">$SYS_LOAD_NUM</span>&quot;</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">bc</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;AutoStart:&quot;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #ff0000;">&quot;%y-%m-%d %H:%M:%S&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #ff0000;">&quot;pkill httpd&quot;</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ps</span> <span style="color: #660033;">-ef</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> httpd <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">wc</span> -l<span style="color: #000000; font-weight: bold;">`</span>
pkill httpd
<span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">10</span>
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000;">1</span> <span style="color: #000000;">2</span> <span style="color: #000000;">3</span>
<span style="color: #000000; font-weight: bold;">do</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">`</span>pgrep httpd <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">wc</span> -l<span style="color: #000000; font-weight: bold;">`</span> <span style="color: #660033;">-le</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">then</span>
service httpd start
<span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">15</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;AutoStart:&quot;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #ff0000;">&quot;%y-%m-%d %H:%M:%S&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #ff0000;">&quot;start httpd&quot;</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ps</span> <span style="color: #660033;">-ef</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> httpd <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">wc</span> -l<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #000000; font-weight: bold;">else</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">`</span>pgrep httpd <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">wc</span> -l<span style="color: #000000; font-weight: bold;">`</span> <span style="color: #660033;">-le</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">then</span>
service httpd start
<span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">15</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;AutoStart:&quot;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #ff0000;">&quot;%y-%m-%d %H:%M:%S&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #ff0000;">&quot;start httpd&quot;</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ps</span> <span style="color: #660033;">-ef</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> httpd <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">wc</span> -l<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></td></tr></table></div>

<p>脚本中TOP_SYS_LOAD_NUM表示最大允许的系统平均负载值，当超过这一值的时候，脚本就开始重启apache服务。脚本的使用也挺简便，直接到/etc/cron.d/ 建立一个定时执行文件，填入如下内容即可：</p>
<p>*/2 * * * * root /root/checkload.sh >>/root/checkload.log</p>
<p>这里*/2，表示每两分钟执行一次指定的脚本，并将执行结果输出到/root/checkload.log文件中。</p>
<p>你也可以根据自己的需要，来修改执行频率。</p>
<h4>小结</h4>
<p>此脚本已经部署到我的VPS上一段时间，从使用的情况来看，效果还比较不错。</p>
<p class="announce"><span style="font-weight:bold;text-shadow:0 1px 0 #ddd;">声明:</span> 此Blog中的文章和随笔仅代表作者在某一特定时间内的观点和结论，对其完全的正确不做任何担保或假设 <br /> 本站文章均采用 <a rel="nofollow" href="http://creativecommons.org/licenses/by-nc-sa/3.0/" title="署名-非商业性使用-相同方式共享">知识共享署名-相同方式共享3.0</a> 协议进行授权，除非注明，本站文章均为原创，转载请注明转自  <a href="http://www.xiaozhou.net">Timothy&#039;s Space</a> 并应以链接形式标明本文地址!</p>]]></content:encoded>
			<wfw:commentRss>http://www.xiaozhou.net/ittech/vps-ittech/vps_web_service_auto_monitoring_and_restarting-2011-05-14.htm/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Linux下的SSH连接管理利器–PAC Manager</title>
		<link>http://www.xiaozhou.net/ittech/linux-ittech/ssh_connection_management_tool_on_linux_pac_manager-2011-01-06.htm</link>
		<comments>http://www.xiaozhou.net/ittech/linux-ittech/ssh_connection_management_tool_on_linux_pac_manager-2011-01-06.htm#comments</comments>
		<pubDate>Thu, 06 Jan 2011 15:01:00 +0000</pubDate>
		<dc:creator>Timothy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Manager]]></category>
		<category><![CDATA[Pac]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[管理]]></category>
		<category><![CDATA[连接]]></category>

		<guid isPermaLink="false">http://www.xiaozhou.net/ittech/linux-ittech/linux%e4%b8%8b%e7%9a%84ssh%e8%bf%9e%e6%8e%a5%e7%ae%a1%e7%90%86%e5%88%a9%e5%99%a8-pac-manager-2011-01-06.htm</guid>
		<description><![CDATA[不知道拥有多个VPS的童鞋，平时是怎样来管理VPS的？在Windows下，我一般用SecureCRT来对VPS进行管理，原因是SecureCRT提供Tab标签管理的方式，多个VPS可以同时进行连接，并通过标签页进行快速切换，非常方便。至于在Linux下，我就只好老老实实的开个Console来连接VPS了。不过，今天发现一个很不错的开源软件，试用了一下，果然是Linux下管理多个VPS的利器，而且还有很多功能非常实用。 Pac Manager的官方地址，在SourceForge上：http://sourceforge.net/projects/pacmanager/ Linux下，可以直接下载发布的deb安装包进行安装。安装Pac Manager，还需要依赖另外一个安装包：libgnome2-vte-perl_0.09-1_i386.deb (64位系统，需要安装这个 libgnome2-vte-perl_0.09-1_amd64.deb)，需要先安装依赖的安装包，再安装Pac Manager，否则会提示错误，找不到依赖的安装包，无法进行安装。 安装好后，就可以在主菜单的Internet子菜单中，找到Pac了。点击，即可启动。 Pac Manager有个非常贴心的功能，就是能用你的桌面背景图片作为SSH界面的背景，让人看起来心旷神怡。左边的连接管理面板，可以添加多个VPS，并且能进行分组管理。连接面板可以点击下面的&#8221;Hide Connections&#8221;进行隐藏和再显示。另外，在这个Tab也中，也可以打开一个Linux下的本地Shell。下面的一排按钮，还有许多其他的功能，童鞋们慢慢体会吧。 配置VPS连接信息的对话框，功能也很全，并且还有端口转发功能(这个功能不用多说了，也就是可以用SSH来跨栏……)，和预处理命令功能，非常强大。 有兴趣的同学不防试试，在Linux下管理你的多个VPS。 声明: 此Blog中的文章和随笔仅代表作者在某一特定时间内的观点和结论，对其完全的正确不做任何担保或假设 本站文章均采用 知识共享署名-相同方式共享3.0 协议进行授权，除非注明，本站文章均为原创，转载请注明转自 Timothy&#039;s Space 并应以链接形式标明本文地址!]]></description>
			<content:encoded><![CDATA[<p>不知道拥有多个VPS的童鞋，平时是怎样来管理VPS的？在Windows下，我一般用SecureCRT来对VPS进行管理，原因是SecureCRT提供Tab标签管理的方式，多个VPS可以同时进行连接，并通过标签页进行快速切换，非常方便。至于在Linux下，我就只好老老实实的开个Console来连接VPS了。不过，今天发现一个很不错的开源软件，试用了一下，果然是Linux下管理多个VPS的利器，而且还有很多功能非常实用。</p>
<p>Pac Manager的官方地址，在SourceForge上：<a title="http://sourceforge.net/projects/pacmanager/" href="http://sourceforge.net/projects/pacmanager/">http://sourceforge.net/projects/pacmanager/</a><br />
Linux下，可以直接下载发布的deb安装包进行安装。安装Pac Manager，还需要依赖另外一个安装包：<a href="http://sourceforge.net/projects/pacmanager/files/libgnome2-vte-perl_0.09-1_i386.deb/download">libgnome2-vte-perl_0.09-1_i386.deb</a> (64位系统，需要安装这个 <a href="http://sourceforge.net/projects/pacmanager/files/libgnome2-vte-perl_0.09-1_amd64.deb/download">libgnome2-vte-perl_0.09-1_amd64.deb</a>)，需要先安装依赖的安装包，再安装Pac Manager，否则会提示错误，找不到依赖的安装包，无法进行安装。</p>
<p>安装好后，就可以在主菜单的Internet子菜单中，找到Pac了。点击，即可启动。<span id="more-916"></span></p>
<p>Pac Manager有个非常贴心的功能，就是能用你的桌面背景图片作为SSH界面的背景，让人看起来心旷神怡。左边的连接管理面板，可以添加多个VPS，并且能进行分组管理。连接面板可以点击下面的&#8221;Hide Connections&#8221;进行隐藏和再显示。另外，在这个Tab也中，也可以打开一个Linux下的本地Shell。下面的一排按钮，还有许多其他的功能，童鞋们慢慢体会吧。</p>
<p><a href="http://www.xiaozhou.net/pics/Linux_13E16/pac1.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border-width: 0px;" title="pac1" src="http://www.xiaozhou.net/pics/Linux_13E16/pac1_thumb.jpg" border="0" alt="pac1" width="644" height="419" /></a></p>
<p>配置VPS连接信息的对话框，功能也很全，并且还有端口转发功能(这个功能不用多说了，也就是可以用SSH来跨栏……)，和预处理命令功能，非常强大。</p>
<p><a href="http://www.xiaozhou.net/pics/Linux_13E16/pac2.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border-width: 0px;" title="pac2" src="http://www.xiaozhou.net/pics/Linux_13E16/pac2_thumb.jpg" border="0" alt="pac2" width="576" height="484" /></a></p>
<p>有兴趣的同学不防试试，在Linux下管理你的多个VPS。</p>
<p class="announce"><span style="font-weight:bold;text-shadow:0 1px 0 #ddd;">声明:</span> 此Blog中的文章和随笔仅代表作者在某一特定时间内的观点和结论，对其完全的正确不做任何担保或假设 <br /> 本站文章均采用 <a rel="nofollow" href="http://creativecommons.org/licenses/by-nc-sa/3.0/" title="署名-非商业性使用-相同方式共享">知识共享署名-相同方式共享3.0</a> 协议进行授权，除非注明，本站文章均为原创，转载请注明转自  <a href="http://www.xiaozhou.net">Timothy&#039;s Space</a> 并应以链接形式标明本文地址!</p>]]></content:encoded>
			<wfw:commentRss>http://www.xiaozhou.net/ittech/linux-ittech/ssh_connection_management_tool_on_linux_pac_manager-2011-01-06.htm/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Linux中随机密码的生成</title>
		<link>http://www.xiaozhou.net/ittech/linux-ittech/generate_random_password_in_linux-2010-07-16.htm</link>
		<comments>http://www.xiaozhou.net/ittech/linux-ittech/generate_random_password_in_linux-2010-07-16.htm#comments</comments>
		<pubDate>Fri, 16 Jul 2010 15:32:00 +0000</pubDate>
		<dc:creator>Timothy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[随机密码]]></category>

		<guid isPermaLink="false">http://www.xiaozhou.net/ittech/linux-ittech/linux%e4%b8%ad%e9%9a%8f%e6%9c%ba%e5%af%86%e7%a0%81%e7%9a%84%e7%94%9f%e6%88%90-2010-07-16.htm</guid>
		<description><![CDATA[Linux中提供方便的让我们生成随机密码的功能，并且生成的密码有一定的复杂度，符合密码规范。下面是Linux中生成随机密码的两种常用的方式： 1.用mkpasswd命令： 使用mkpasswd命令，需要事先安装expect模块，以CentOS为例: ?View Code BASH1 yum -y install expect 安装好后，直接运行mkpasswd，就能生成随机密码了。并且命令还有参数，比如设置生成的随机密码的最小长度，等等，看看help就知道了。 2.用passwdgen命令: 和mkpasswd大致一致，需事先安装passwdgen模块: ?View Code BASH1 yum -y install passwdgen 安装好后，直接运行passwdgen，即可得到随机密码，同样passwdgen命令也有参数，可以参考help。 声明: 此Blog中的文章和随笔仅代表作者在某一特定时间内的观点和结论，对其完全的正确不做任何担保或假设 本站文章均采用 知识共享署名-相同方式共享3.0 协议进行授权，除非注明，本站文章均为原创，转载请注明转自 Timothy&#039;s Space 并应以链接形式标明本文地址!]]></description>
			<content:encoded><![CDATA[<p>Linux中提供方便的让我们生成随机密码的功能，并且生成的密码有一定的复杂度，符合密码规范。下面是Linux中生成随机密码的两种常用的方式：</p>
<h5>1.用mkpasswd命令：</h5>
<p>使用mkpasswd命令，需要事先安装expect模块，以CentOS为例:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p751code7'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p7517"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p751code7"><pre class="bash" style="font-family:monospace;">yum <span style="color: #660033;">-y</span> <span style="color: #c20cb9; font-weight: bold;">install</span> expect</pre></td></tr></table></div>

<p>安装好后，直接运行mkpasswd，就能生成随机密码了。并且命令还有参数，比如设置生成的随机密码的最小长度，等等，看看help就知道了。</p>
<h5>2.用passwdgen命令:</h5>
<p>和mkpasswd大致一致，需事先安装passwdgen模块:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p751code8'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p7518"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p751code8"><pre class="bash" style="font-family:monospace;">yum <span style="color: #660033;">-y</span> <span style="color: #c20cb9; font-weight: bold;">install</span> passwdgen</pre></td></tr></table></div>

<p>安装好后，直接运行passwdgen，即可得到随机密码，同样passwdgen命令也有参数，可以参考help。</p>
<p class="announce"><span style="font-weight:bold;text-shadow:0 1px 0 #ddd;">声明:</span> 此Blog中的文章和随笔仅代表作者在某一特定时间内的观点和结论，对其完全的正确不做任何担保或假设 <br /> 本站文章均采用 <a rel="nofollow" href="http://creativecommons.org/licenses/by-nc-sa/3.0/" title="署名-非商业性使用-相同方式共享">知识共享署名-相同方式共享3.0</a> 协议进行授权，除非注明，本站文章均为原创，转载请注明转自  <a href="http://www.xiaozhou.net">Timothy&#039;s Space</a> 并应以链接形式标明本文地址!</p>]]></content:encoded>
			<wfw:commentRss>http://www.xiaozhou.net/ittech/linux-ittech/generate_random_password_in_linux-2010-07-16.htm/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Ubuntu 10.04 LTS 安装手记及体验</title>
		<link>http://www.xiaozhou.net/ittech/linux-ittech/ubuntu_10_04_lts_installation_and_experience-2010-05-02.htm</link>
		<comments>http://www.xiaozhou.net/ittech/linux-ittech/ubuntu_10_04_lts_installation_and_experience-2010-05-02.htm#comments</comments>
		<pubDate>Sun, 02 May 2010 14:44:52 +0000</pubDate>
		<dc:creator>Timothy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[体验]]></category>
		<category><![CDATA[安装]]></category>
		<category><![CDATA[手记]]></category>

		<guid isPermaLink="false">http://www.xiaozhou.net/?p=595</guid>
		<description><![CDATA[从Ubuntu的官网发布开始倒计时的时候，我就掰着手指，等着新版Ubuntu的最终发布。在临近发布的时候，还有爆料说Ubuntu发现重大bug，导致安装后引导程序会出现问题，不过这个BUG在最终发布的时候还是修复了。正式发布的第二天，俺就迫不及待的从官网拖了一个Ubuntu 10.04 64bit的Desktop版本，准备装在笔记本上，原因是笔记本是4G内存(嘿嘿……)。 继续按照老的套路，从U盘安装Ubuntu，这样可以不用刻光盘，避免浪费，且安装速度快，绿色，环保。整个安装过程很简洁，而且不到10分钟，就搞定了，这速度，比起安装Windows,实在有点出乎意料。而且比起自家大哥Ubuntu 9系列还要快，因为Ubuntu 9在安装时还要在线下载一些东西，会耽误一定的时间。 安装完毕，第一次进入Ubuntu 10，给人比较耳目一新的感觉，特比是菜单栏上多出的一个聊天帐号设置，包括众多兼容的实时聊天软件，这也是Ubuntu 10主打的一特色：加强的社区交互功能。另外值得一提的是Ubuntu One，Ubuntu的云集算服务功能，相当不错。目前Ubuntu对硬件的识别更加友好了，在ThinkPad的机器上，根本不用安装任何驱动，Ubuntu已经能自动识别包括：声卡/无线网卡/以太网卡/声音调整按钮/蓝牙/亮度调节 等等驱动，非常人性化。而且发现Ubuntu本身已经自带了非常流行的iBus输入法，只需要再在机器的语言支持中，装上中文和一些其他附带的东东，就可以方便的用iBus输入中文了，这又算是个亮点。 作为一款粉丝众多的Linux发行版本，Ubuntu在用户易用性和UI上花了不少的功夫，并且自带的一系列软件，足以满足用户一般的上网/图片处理/文字处理等需求，看来国内用户要逐步脱离Win的束缚，迁移到Linux的日子不远了…… 本文纯属自己使用Ubuntu Linux的一些流水帐和感受，欢迎各位同学交流。 PS:本文发自 Ubuntu 10.04 LTS 64bit Desktop Edition ，小小纪念一下。 声明: 此Blog中的文章和随笔仅代表作者在某一特定时间内的观点和结论，对其完全的正确不做任何担保或假设 本站文章均采用 知识共享署名-相同方式共享3.0 协议进行授权，除非注明，本站文章均为原创，转载请注明转自 Timothy&#039;s Space 并应以链接形式标明本文地址!]]></description>
			<content:encoded><![CDATA[<p>从Ubuntu的官网发布开始倒计时的时候，我就掰着手指，等着新版Ubuntu的最终发布。在临近发布的时候，还有爆料说Ubuntu发现重大bug，导致安装后引导程序会出现问题，不过这个BUG在最终发布的时候还是修复了。正式发布的第二天，俺就迫不及待的从官网拖了一个Ubuntu 10.04 64bit的Desktop版本，准备装在笔记本上，原因是笔记本是4G内存(嘿嘿……)。 继续按照老的套路，从U盘安装Ubuntu，这样可以不用刻光盘，避免浪费，且安装速度快，绿色，环保。整个安装过程很简洁，而且不到10分钟，就搞定了，这速度，比起安装Windows,实在有点出乎意料。而且比起自家大哥Ubuntu 9系列还要快，因为Ubuntu 9在安装时还要在线下载一些东西，会耽误一定的时间。</p>
<p>安装完毕，第一次进入Ubuntu 10，给人比较耳目一新的感觉，特比是菜单栏上多出的一个聊天帐号设置，包括众多兼容的实时聊天软件，这也是Ubuntu 10主打的一特色：加强的社区交互功能。另外值得一提的是Ubuntu One，Ubuntu的云集算服务功能，相当不错。目前Ubuntu对硬件的识别更加友好了，在ThinkPad的机器上，根本不用安装任何驱动，Ubuntu已经能自动识别包括：声卡/无线网卡/以太网卡/声音调整按钮/蓝牙/亮度调节 等等驱动，非常人性化。而且发现Ubuntu本身已经自带了非常流行的iBus输入法，只需要再在机器的语言支持中，装上中文和一些其他附带的东东，就可以方便的用iBus输入中文了，这又算是个亮点。</p>
<p>作为一款粉丝众多的Linux发行版本，Ubuntu在用户易用性和UI上花了不少的功夫，并且自带的一系列软件，足以满足用户一般的上网/图片处理/文字处理等需求，看来国内用户要逐步脱离Win的束缚，迁移到Linux的日子不远了……</p>
<p>本文纯属自己使用Ubuntu Linux的一些流水帐和感受，欢迎各位同学交流。</p>
<p>PS:本文发自 Ubuntu 10.04 LTS 64bit Desktop Edition ，小小纪念一下。</p>
<p class="announce"><span style="font-weight:bold;text-shadow:0 1px 0 #ddd;">声明:</span> 此Blog中的文章和随笔仅代表作者在某一特定时间内的观点和结论，对其完全的正确不做任何担保或假设 <br /> 本站文章均采用 <a rel="nofollow" href="http://creativecommons.org/licenses/by-nc-sa/3.0/" title="署名-非商业性使用-相同方式共享">知识共享署名-相同方式共享3.0</a> 协议进行授权，除非注明，本站文章均为原创，转载请注明转自  <a href="http://www.xiaozhou.net">Timothy&#039;s Space</a> 并应以链接形式标明本文地址!</p>]]></content:encoded>
			<wfw:commentRss>http://www.xiaozhou.net/ittech/linux-ittech/ubuntu_10_04_lts_installation_and_experience-2010-05-02.htm/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>VPS SSH故障及解决</title>
		<link>http://www.xiaozhou.net/ittech/vps-ittech/vps_ssh_problem_fix-2010-03-16.htm</link>
		<comments>http://www.xiaozhou.net/ittech/vps-ittech/vps_ssh_problem_fix-2010-03-16.htm#comments</comments>
		<pubDate>Tue, 16 Mar 2010 15:41:00 +0000</pubDate>
		<dc:creator>Timothy</dc:creator>
				<category><![CDATA[vps]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[sshd]]></category>
		<category><![CDATA[故障]]></category>
		<category><![CDATA[解决]]></category>

		<guid isPermaLink="false">http://www.xiaozhou.net/ittech/vps-ittech/vps-ssh%e6%95%85%e9%9a%9c%e5%8f%8a%e8%a7%a3%e5%86%b3-2010-03-16.htm</guid>
		<description><![CDATA[这两天加班，没时间顾及VPS。晚上没事用SecureCRT，通过SSH连接VPS，发现VPS拒绝连接。奇怪了，VPS的站点能访问，iptables也没限制SSH端口，除非是sshd服务挂了。登陆VPS的web管理界面一看，果然sshd这进程从列表中消失了。直接运行/etc/init.d/ssh start，系统返回异常：ssh 无法启动， /dev/null is not a character device 这错误提示看得我一头雾水，难道sshd服务，还跟那个/dev/null设备有关系？带着疑问去请教了下google老师，原来别人也有遇到这样的问题。sshd确实和这设备有关，如果/dev/null被损坏，ssh启动，就会有如此提示。既然问题找到了，是/dev/null损坏，我们需要重建一个，用下面的命令即可修复： ?View Code BASH1 2 3 rm /dev/null mknod /dev/null c 1 3 chmod 666 /dev/null 待/dev/null重建好后，直接在VPS的web管理页面中，运行 /etc/init.d/ssh start，久违的sshd服务就回来了。回忆了下，前两天打开了corn服务，有个每天定时执行的和日志关的脚本，会去修改/dev/null，立马屏蔽之，重启cron服务后，一切正常。 声明: 此Blog中的文章和随笔仅代表作者在某一特定时间内的观点和结论，对其完全的正确不做任何担保或假设 本站文章均采用 知识共享署名-相同方式共享3.0 协议进行授权，除非注明，本站文章均为原创，转载请注明转自 Timothy&#039;s Space 并应以链接形式标明本文地址!]]></description>
			<content:encoded><![CDATA[<p>这两天加班，没时间顾及VPS。晚上没事用SecureCRT，通过SSH连接VPS，发现VPS拒绝连接。奇怪了，VPS的站点能访问，iptables也没限制SSH端口，除非是sshd服务挂了。登陆VPS的web管理界面一看，果然sshd这进程从列表中消失了。直接运行/etc/init.d/ssh start，系统返回异常：ssh 无法启动， /dev/null is not a character device 这错误提示看得我一头雾水，难道sshd服务，还跟那个/dev/null设备有关系？带着疑问去请教了下google老师，原来别人也有遇到这样的问题。sshd确实和这设备有关，如果/dev/null被损坏，ssh启动，就会有如此提示。既然问题找到了，是/dev/null损坏，我们需要重建一个，用下面的命令即可修复：    </p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p560code10'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p56010"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p560code10"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null
<span style="color: #c20cb9; font-weight: bold;">mknod</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null c <span style="color: #000000;">1</span> <span style="color: #000000;">3</span>
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">666</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null</pre></td></tr></table></div>

</p>
<p>待/dev/null重建好后，直接在VPS的web管理页面中，运行 /etc/init.d/ssh start，久违的sshd服务就回来了。回忆了下，前两天打开了corn服务，有个每天定时执行的和日志关的脚本，会去修改/dev/null，立马屏蔽之，重启cron服务后，一切正常。</p>
<p class="announce"><span style="font-weight:bold;text-shadow:0 1px 0 #ddd;">声明:</span> 此Blog中的文章和随笔仅代表作者在某一特定时间内的观点和结论，对其完全的正确不做任何担保或假设 <br /> 本站文章均采用 <a rel="nofollow" href="http://creativecommons.org/licenses/by-nc-sa/3.0/" title="署名-非商业性使用-相同方式共享">知识共享署名-相同方式共享3.0</a> 协议进行授权，除非注明，本站文章均为原创，转载请注明转自  <a href="http://www.xiaozhou.net">Timothy&#039;s Space</a> 并应以链接形式标明本文地址!</p>]]></content:encoded>
			<wfw:commentRss>http://www.xiaozhou.net/ittech/vps-ittech/vps_ssh_problem_fix-2010-03-16.htm/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>vps中的iptables规则设置范例</title>
		<link>http://www.xiaozhou.net/ittech/linux-ittech/vps_iptables_setting_example-2010-02-26.htm</link>
		<comments>http://www.xiaozhou.net/ittech/linux-ittech/vps_iptables_setting_example-2010-02-26.htm#comments</comments>
		<pubDate>Fri, 26 Feb 2010 14:25:33 +0000</pubDate>
		<dc:creator>Timothy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[setting]]></category>
		<category><![CDATA[vps]]></category>
		<category><![CDATA[规则]]></category>
		<category><![CDATA[设置]]></category>

		<guid isPermaLink="false">http://www.xiaozhou.net/?p=543</guid>
		<description><![CDATA[忙乎了一两天，俺的VPS算是上线了，基于Ubuntu Linux的，512MB内存，20G硬盘，1TB月流量，赠送2个IP，还不错。不过，现在还没有把博客迁移过去的打算，此VPS仅作为练手而用，只是建了一些ssh账号，供自己和同事跨栏用，还简单的搭建了基于Nginx+MySql+PHP+FastCGI的WordPress环境，并成功拉过来俺的一位同事在上面安了个blog，嘿嘿。 提到VPS，最重要的还是安全，毕竟你的系统是直接面向公网，如果不加强防范，很容易成为别人手里的肉鸡。Linux中的iptables，用过的同学都知道，是一个基于Linux内核的防火墙，功能比较强大，下面是iptable的一些常用的规则设置： ?View Code BASH1 2 3 4 5 6 7 8 9 10 11 12 /sbin/iptables -P INPUT DROP #禁止掉服务器所有入口请求，后面的规则只允许部分常用的服务端口 /sbin/iptables -P OUTPUT ACCEPT #允许服务器访问出口请求 /sbin/iptables -A INPUT -i lo -j ACCEPT #允许本地接口访问 /sbin/iptables -A INPUT -p icmp -m icmp --icmp-type 8 -j DROP #禁止ping，因为ping是基于icmp协议的 /sbin/iptables -A INPUT -p tcp -m tcp --dport [...]]]></description>
			<content:encoded><![CDATA[<p>忙乎了一两天，俺的VPS算是上线了，基于Ubuntu Linux的，512MB内存，20G硬盘，1TB月流量，赠送2个IP，还不错。不过，现在还没有把博客迁移过去的打算，此VPS仅作为练手而用，只是建了一些ssh账号，供自己和同事跨栏用，还简单的搭建了基于Nginx+MySql+PHP+FastCGI的WordPress环境，并成功拉过来俺的一位同事在上面安了个blog，嘿嘿。<br />
提到VPS，最重要的还是安全，毕竟你的系统是直接面向公网，如果不加强防范，很容易成为别人手里的肉鸡。Linux中的iptables，用过的同学都知道，是一个基于Linux内核的防火墙，功能比较强大，下面是iptable的一些常用的规则设置：</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p543code13'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p54313"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code" id="p543code13"><pre class="bash" style="font-family:monospace;">        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-P</span> INPUT DROP              <span style="color: #666666; font-style: italic;">#禁止掉服务器所有入口请求，后面的规则只允许部分常用的服务端口</span>
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-P</span> OUTPUT ACCEPT          <span style="color: #666666; font-style: italic;">#允许服务器访问出口请求</span>
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-i</span> lo <span style="color: #660033;">-j</span> ACCEPT    <span style="color: #666666; font-style: italic;">#允许本地接口访问</span>
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> icmp <span style="color: #660033;">-m</span> icmp <span style="color: #660033;">--icmp-type</span> <span style="color: #000000;">8</span> <span style="color: #660033;">-j</span> DROP <span style="color: #666666; font-style: italic;">#禁止ping，因为ping是基于icmp协议的</span>
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">20</span> <span style="color: #660033;">-j</span> ACCEPT    <span style="color: #666666; font-style: italic;">#允许部分常用端口入口请求访问</span>
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">21</span> <span style="color: #660033;">-j</span> ACCEPT
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">25</span> <span style="color: #660033;">-j</span> ACCEPT
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">53</span> <span style="color: #660033;">-j</span> ACCEPT
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> udp <span style="color: #660033;">-m</span> udp <span style="color: #660033;">--dport</span> <span style="color: #000000;">53</span> <span style="color: #660033;">-j</span> ACCEPT
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">80</span> <span style="color: #660033;">-j</span> ACCEPT
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> all <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> ESTABLISHED,RELATED <span style="color: #660033;">-j</span> ACCEPT  <span style="color: #666666; font-style: italic;">#允许所有已经连接端口请求</span>
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> all <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> INVALID,NEW <span style="color: #660033;">-j</span> DROP              <span style="color: #666666; font-style: italic;">#DROP掉所有失效或者新的请求</span></pre></td></tr></table></div>

<p>可以把上述脚本保存起来，执行，然后用命令/sbin/iptables -L -n查看规则是否生效</p>
<p>把上述脚本再完善一下:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p543code14'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p54314"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
</pre></td><td class="code" id="p543code14"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">PATH</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>sbin:~<span style="color: #000000; font-weight: bold;">/</span>bin
<span style="color: #7a0874; font-weight: bold;">export</span> PATH
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
start<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;Staring to write your Iptbales:...&quot;</span>
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-P</span> INPUT DROP
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-P</span> OUTPUT ACCEPT
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-i</span> lo <span style="color: #660033;">-j</span> ACCEPT
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> icmp <span style="color: #660033;">-m</span> icmp <span style="color: #660033;">--icmp-type</span> <span style="color: #000000;">8</span> <span style="color: #660033;">-j</span> DROP
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">20</span> <span style="color: #660033;">-j</span> ACCEPT
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">21</span> <span style="color: #660033;">-j</span> ACCEPT
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">25</span> <span style="color: #660033;">-j</span> ACCEPT
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">53</span> <span style="color: #660033;">-j</span> ACCEPT
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> udp <span style="color: #660033;">-m</span> udp <span style="color: #660033;">--dport</span> <span style="color: #000000;">53</span> <span style="color: #660033;">-j</span> ACCEPT
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">80</span> <span style="color: #660033;">-j</span> ACCEPT
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> all <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> ESTABLISHED,RELATED <span style="color: #660033;">-j</span> ACCEPT
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> all <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> INVALID,NEW <span style="color: #660033;">-j</span> DROP
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Ok&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">;;</span>
stop<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;Cleaning your Iptables:...&quot;</span>
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-F</span>
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-X</span>
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-Z</span>
	<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-P</span> INPUT ACCEPT
	<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-P</span> OUTPUT ACCEPT
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Ok&quot;</span>
<span style="color: #000000; font-weight: bold;">;;</span>
restart<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;Cleaning your Iptables:...&quot;</span>
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-F</span>
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-X</span>
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-Z</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Ok&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;Staring to write your Iptbales:...&quot;</span>
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-P</span> INPUT DROP
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-P</span> OUTPUT ACCEPT
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-i</span> lo <span style="color: #660033;">-j</span> ACCEPT
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> icmp <span style="color: #660033;">-m</span> icmp <span style="color: #660033;">--icmp-type</span> <span style="color: #000000;">8</span> <span style="color: #660033;">-j</span> DROP
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">20</span> <span style="color: #660033;">-j</span> ACCEPT
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">21</span> <span style="color: #660033;">-j</span> ACCEPT
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">25</span> <span style="color: #660033;">-j</span> ACCEPT
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">53</span> <span style="color: #660033;">-j</span> ACCEPT
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> udp <span style="color: #660033;">-m</span> udp <span style="color: #660033;">--dport</span> <span style="color: #000000;">53</span> <span style="color: #660033;">-j</span> ACCEPT       
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">80</span> <span style="color: #660033;">-j</span> ACCEPT
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> all <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> ESTABLISHED,RELATED <span style="color: #660033;">-j</span> ACCEPT
        <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> all <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> INVALID,NEW <span style="color: #660033;">-j</span> DROP
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Ok&quot;</span>
<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage: $0          {start|stop|restart}&quot;</span>
<span style="color: #000000; font-weight: bold;">esac</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></td></tr></table></div>

<p>这样，我们就可以用start/stop/restart的参数来启用、禁止iptables防护了，很方便。另外，可以把此脚本放入/etc/init.d，让它像系统服务一样，在VPS启动的时候自动运行。</p>
<p>PS:<br />
1.此脚本参考自网上，并作了部分修改<br />
2.搜狗云输入法，也有郁闷的时候，在写文章的时候，候选词半天不出来，很卡，囧rz 是我打字速度太快，还是网速很慢？……</p>
<p class="announce"><span style="font-weight:bold;text-shadow:0 1px 0 #ddd;">声明:</span> 此Blog中的文章和随笔仅代表作者在某一特定时间内的观点和结论，对其完全的正确不做任何担保或假设 <br /> 本站文章均采用 <a rel="nofollow" href="http://creativecommons.org/licenses/by-nc-sa/3.0/" title="署名-非商业性使用-相同方式共享">知识共享署名-相同方式共享3.0</a> 协议进行授权，除非注明，本站文章均为原创，转载请注明转自  <a href="http://www.xiaozhou.net">Timothy&#039;s Space</a> 并应以链接形式标明本文地址!</p>]]></content:encoded>
			<wfw:commentRss>http://www.xiaozhou.net/ittech/linux-ittech/vps_iptables_setting_example-2010-02-26.htm/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>台式机换上了Ubuntu</title>
		<link>http://www.xiaozhou.net/ittech/software/installation_of_ubuntu-2010-02-21.htm</link>
		<comments>http://www.xiaozhou.net/ittech/software/installation_of_ubuntu-2010-02-21.htm#comments</comments>
		<pubDate>Sun, 21 Feb 2010 09:57:00 +0000</pubDate>
		<dc:creator>Timothy</dc:creator>
				<category><![CDATA[软件使用]]></category>
		<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Edition]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[台式机]]></category>
		<category><![CDATA[老牛机]]></category>

		<guid isPermaLink="false">http://www.xiaozhou.net/ittech/software/%e5%8f%b0%e5%bc%8f%e6%9c%ba%e6%8d%a2%e4%b8%8a%e4%ba%86ubuntu-2010-02-21.htm</guid>
		<description><![CDATA[这段时间对Linux相当痴迷，玩了下CentOS，现在又看上了Ubuntu。对Ubuntu偶早有所闻了，以前也在虚拟机上装过，那漂亮的UI是各个Linux版本中相当出众的，安装、维护的简单和方便，也是至今都Ubuntu拥有众多追随者的原因。正好，俺家中有一台老牛机(以前大学时候用的台式机)，这机器历史算长久了，从大二一直跟随俺到现在，有7、8年历史了。毕业后把这台机器略升级了一下，到现在都一直闲置在书房中，完全成了摆设。自从用上了笔记本，老婆也用上了上网本，这台台式机更是没人用了。昨天突然心血来潮，决定在老牛机上装个Ubuntu玩玩，没事了还可以开着下下高清BT，充分利用下闲置资源。 老牛机配置如下：&#160; CPU:&#160; Athlon 1700+&#160; 内存:&#160; KingSton 1.5GB(1G*1+256*2) 硬盘:&#160; 希捷80G IDE接口 显卡:&#160; Geforce 6200 主板:&#160; nForce2 开始行动 说干就干，首先在Ubuntu的老家拖了个最新的Ubuntu 9.10 32bit Desktop Edition的ISO。老牛机的光驱，经久失修，已经是个残废了。本来想扔掉的，但机箱面板那个挡板也被我搞掉了，扔掉光驱就有个缺口，不美观，只有留下了。主板支持4个USB接口，两个坏掉了，剩下两个还可用，刚好偶又有个2G的U盘(捡来的)，所以打算通过U盘来安装系统。用U盘装系统好处多多，不用刻盘，并且速度比光驱快，嘿嘿。 用Ultra ISO利器，把安装镜像写入到U盘： 写完后的U盘驱动器图标： &#160; 安装系统 拔下U盘，插上老牛机器，一步一步安装，Ubuntu从此跑在了老牛机上，发现比以前的XP快不少。并且Ubuntu支持大部分硬件，无须驱动，显卡驱动可以用Ubuntu默认的，也可以自己单独安装。安装界面也相当的友好，即使是第一次使用的用户，也能根据向导来完成安装。 一点使用体验 1.5G的内存，运行Linux当然会快很多，从开机和系统加载的速度就可以感受到，比以前的XP快不少。装上显卡驱动后，能打开一些可视化特效，比较炫。 由于Ubuntu自带Firefox浏览器，于是立马装上了AutoProxy插件，再用Linux自带的ssh命令，加上一个国外的SSH帐号，立马实现了跨栏的效果……为了以后方便，做了个简单的shell脚本： ?View Code BASH1 2 echo &#34;ssh -N -D 127.0.0.1:7070 ssh-account@server-address&#34; &#62; connect.sh chmod +x connect.sh -N: 不需要shell登陆 -D: 建立本地端口映射，这里使用的7070端口，把这端口配置到AutoProxy里面去，就OK了 后面是ssh-username@server-ip 控制台运行此脚本后，会提示输入ssh密码，输入后，连接完毕，可以打开Firefox畅游了 关于BT下载工具，偶用Transmission，貌似Ubuntu已经自带了，没有的也可以单独安装。 关于中文输入法，偶一般是在浏览网页时输入中文，Firefox可以装一个搜狗的云输入插件，方便、绿色、环保，强烈推荐下。 小结一下 [...]]]></description>
			<content:encoded><![CDATA[<p>这段时间对Linux相当痴迷，玩了下CentOS，现在又看上了Ubuntu。对Ubuntu偶早有所闻了，以前也在虚拟机上装过，那漂亮的UI是各个Linux版本中相当出众的，安装、维护的简单和方便，也是至今都Ubuntu拥有众多追随者的原因。正好，俺家中有一台老牛机(以前大学时候用的台式机)，这机器历史算长久了，从大二一直跟随俺到现在，有7、8年历史了。毕业后把这台机器略升级了一下，到现在都一直闲置在书房中，完全成了摆设。自从用上了笔记本，老婆也用上了上网本，这台台式机更是没人用了。昨天突然心血来潮，决定在老牛机上装个Ubuntu玩玩，没事了还可以开着下下高清BT，充分利用下闲置资源。    </p>
<p>老牛机配置如下：&#160; <br />CPU:&#160; Athlon 1700+&#160; <br />内存:&#160; KingSton 1.5GB(1G*1+256*2)     <br />硬盘:&#160; 希捷80G IDE接口     <br />显卡:&#160; Geforce 6200     <br />主板:&#160; nForce2</p>
<h4>开始行动</h4>
<p>说干就干，首先在<a href="http://www.ubuntu.com/getubuntu/download" target="_blank">Ubuntu的老家</a>拖了个最新的Ubuntu 9.10 32bit Desktop Edition的ISO。老牛机的光驱，经久失修，已经是个残废了。本来想扔掉的，但机箱面板那个挡板也被我搞掉了，扔掉光驱就有个缺口，不美观，只有留下了。主板支持4个USB接口，两个坏掉了，剩下两个还可用，刚好偶又有个2G的U盘(捡来的)，所以打算通过U盘来安装系统。用U盘装系统好处多多，不用刻盘，并且速度比光驱快，嘿嘿。     </p>
<p>用Ultra ISO利器，把安装镜像写入到U盘：</p>
<p><a href="http://www.xiaozhou.net/pics/Ubuntu_FC85/ubuntu.jpg"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="ubuntu" border="0" alt="ubuntu" src="http://www.xiaozhou.net/pics/Ubuntu_FC85/ubuntu_thumb.jpg" width="569" height="449" /></a>     <br />写完后的U盘驱动器图标：     <br /><a href="http://www.xiaozhou.net/pics/Ubuntu_FC85/ubuntu2.jpg"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="ubuntu2" border="0" alt="ubuntu2" src="http://www.xiaozhou.net/pics/Ubuntu_FC85/ubuntu2_thumb.jpg" width="266" height="73" /></a>&#160;</p>
<h4>安装系统</h4>
<p>拔下U盘，插上老牛机器，一步一步安装，Ubuntu从此跑在了老牛机上，发现比以前的XP快不少。并且Ubuntu支持大部分硬件，无须驱动，显卡驱动可以用Ubuntu默认的，也可以自己单独安装。安装界面也相当的友好，即使是第一次使用的用户，也能根据向导来完成安装。</p>
<h4>一点使用体验</h4>
<p>1.5G的内存，运行Linux当然会快很多，从开机和系统加载的速度就可以感受到，比以前的XP快不少。装上显卡驱动后，能打开一些可视化特效，比较炫。    <br />由于Ubuntu自带Firefox浏览器，于是立马装上了AutoProxy插件，再用Linux自带的ssh命令，加上一个国外的SSH帐号，立马实现了跨栏的效果……为了以后方便，做了个简单的shell脚本：</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p537code16'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p53716"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p537code16"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;ssh -N -D 127.0.0.1:7070 ssh-account@server-address&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> connect.sh
<span style="color: #c20cb9; font-weight: bold;">chmod</span> +x connect.sh</pre></td></tr></table></div>

<p>-N: 不需要shell登陆 </p>
<p>-D: 建立本地端口映射，这里使用的7070端口，把这端口配置到AutoProxy里面去，就OK了</p>
<p>后面是ssh-username@server-ip</p>
<p>控制台运行此脚本后，会提示输入ssh密码，输入后，连接完毕，可以打开Firefox畅游了</p>
<p>关于BT下载工具，偶用<a href="http://www.transmissionbt.com/download.php" target="_blank">Transmission</a>，貌似Ubuntu已经自带了，没有的也可以单独安装。</p>
<p>关于中文输入法，偶一般是在浏览网页时输入中文，Firefox可以装一个搜狗的<a href="http://pinyin.sogou.com/cloud/ff.html" target="_blank">云输入插件</a>，方便、绿色、环保，强烈推荐下。</p>
<h4></h4>
<h4>小结一下</h4>
<p>老牛机器装上Linux感觉挺赞，如同重新焕发了活力一般。家有闲置老牛机的同学不妨试一试。</p>
<p class="announce"><span style="font-weight:bold;text-shadow:0 1px 0 #ddd;">声明:</span> 此Blog中的文章和随笔仅代表作者在某一特定时间内的观点和结论，对其完全的正确不做任何担保或假设 <br /> 本站文章均采用 <a rel="nofollow" href="http://creativecommons.org/licenses/by-nc-sa/3.0/" title="署名-非商业性使用-相同方式共享">知识共享署名-相同方式共享3.0</a> 协议进行授权，除非注明，本站文章均为原创，转载请注明转自  <a href="http://www.xiaozhou.net">Timothy&#039;s Space</a> 并应以链接形式标明本文地址!</p>]]></content:encoded>
			<wfw:commentRss>http://www.xiaozhou.net/ittech/software/installation_of_ubuntu-2010-02-21.htm/feed</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>

