<?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>Star life &#187; Howto</title>
	<atom:link href="http://liuchangjun.com/tag/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://liuchangjun.com</link>
	<description>Welcome to Hangzhou, zj, cn – star@zuoan</description>
	<lastBuildDate>Tue, 07 Sep 2010 07:30:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Howto: 安装使用MRTG，服务器性能监控，CPU / MEM / IO / Network</title>
		<link>http://liuchangjun.com/2010/03/03/mrtg-start/</link>
		<comments>http://liuchangjun.com/2010/03/03/mrtg-start/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 08:54:03 +0000</pubDate>
		<dc:creator>star</dc:creator>
				<category><![CDATA[Tech Tools]]></category>
		<category><![CDATA[deepin]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mrtg]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://liuchangjun.com/?p=195</guid>
		<description><![CDATA[项目需要对版本进行比较，对比各种运行的性能，包括 CPU / MEM / IO / Network 等等。 开源的软件有：MRTG / Cacti / Nagios etc. 1. LinuxDeepin &#8211; Ubuntu 9.12 $ sudo apt-get install snmpd mrtg $ sudo vi /etc/snmp/snmpd.conf # sec.name source community #com2sec paranoid default public #注释掉这行 com2sec readonly default public #再把这行打开 #com2sec readwrite default private $ sudo /etc/init.d/snmpd restart 生成配置文件： $ cfgmaker [...]]]></description>
			<content:encoded><![CDATA[<p>项目需要对版本进行比较，对比各种运行的性能，包括 CPU / MEM / IO / Network 等等。<br />
开源的软件有：MRTG / Cacti / Nagios etc.</p>
<p>1. LinuxDeepin &#8211; Ubuntu 9.12</p>
<p>$ sudo apt-get install snmpd mrtg<br />
$ sudo vi /etc/snmp/snmpd.conf</p>
<blockquote><p>#       sec.name  source          community<br />
#com2sec paranoid  default         public   #注释掉这行<br />
com2sec readonly  default         public    #再把这行打开<br />
#com2sec readwrite default         private</p></blockquote>
<p>$ sudo /etc/init.d/snmpd restart</p>
<p>生成配置文件：<br />
$ cfgmaker &#8211;global &#8220;WorkDir: /home/mrtg&#8221; public@localhost | sudo tee /etc/mrtg.cfg</p>
<p>生成HTML文件，修改配置文件后需要重新生成一次：<br />
$ sudo indexmaker /etc/mrtg.cfg | sudo tee /home/mrtg/index.html</p>
<p>注：需要通过HTTP服务器进行查看，可以<a href="http://liuchangjun.com/2010/03/03/lnmp-start/">安装使用LNMP</a>。</p>
<p>Refer to:<br />
<a href="http://li2z.cn/2009/09/25/ubuntu_mrtg/">ubuntu下，给现有网站加个简单的流量监控的方法</a><br />
<a href="http://imtx.cn/archives/1396.html">用MRTG監控服務器的CPU和Memory</a><br />
<a href="http://blog.chinaunix.net/u/249/showart.php?id=2090254">CentOS5.4 安装mrtg</a></p>
]]></content:encoded>
			<wfw:commentRss>http://liuchangjun.com/2010/03/03/mrtg-start/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Howto: 安装使用LNMP &#8211; Linux / Nginx / MySQL / Php</title>
		<link>http://liuchangjun.com/2010/03/03/lnmp-start/</link>
		<comments>http://liuchangjun.com/2010/03/03/lnmp-start/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 07:40:31 +0000</pubDate>
		<dc:creator>star</dc:creator>
				<category><![CDATA[Tech Tools]]></category>
		<category><![CDATA[deepin]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lnmp]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://liuchangjun.com/?p=194</guid>
		<description><![CDATA[1. LNMP一键安装包是一个用Linux Shell编写的可以为CentOS/RadHat、Debian/Ubuntu VPS(VDS)或独立主机安装LNMP(Nginx、MySQL、PHP、phpMyAdmin)生产环境的Shell程序。 Homepage: http://lnmp.org/ 安装那些软件 # Nginx # MySQL # PHP # PHPMyAdmin # Zend Optimizer # eAccelerator # Nginx-RRD # vsFTPD 2. 由Licess开发维护。 Homepage: http://licess.cn/ 3. 安装步骤 系统为Linux Deepin，基于Ubuntu 9.12 $ uname -a Linux xxx 2.6.31-19-generic #56-Ubuntu SMP Thu Jan 28 01:26:53 UTC 2010 i686 GNU/Linux $ sudo su # wget http://soft.vpser.net/lnmp/lnmp0.3.tar.gz [...]]]></description>
			<content:encoded><![CDATA[<p>1. LNMP一键安装包是一个用Linux Shell编写的可以为CentOS/RadHat、Debian/Ubuntu VPS(VDS)或独立主机安装LNMP(Nginx、MySQL、PHP、phpMyAdmin)生产环境的Shell程序。<br />
Homepage: <a href="http://lnmp.org/">http://lnmp.org/</a></p>
<p>安装那些软件<br />
# Nginx<br />
# MySQL<br />
# PHP<br />
# PHPMyAdmin<br />
# Zend Optimizer<br />
# eAccelerator<br />
# Nginx-RRD<br />
# vsFTPD</p>
<p>2. 由Licess开发维护。<br />
Homepage: <a href="http://licess.cn/">http://licess.cn/</a></p>
<p>3. 安装步骤<br />
系统为Linux Deepin，基于Ubuntu 9.12<br />
$ uname -a<br />
Linux xxx 2.6.31-19-generic #56-Ubuntu SMP Thu Jan 28 01:26:53 UTC 2010 i686 GNU/Linux<br />
$ sudo su<br />
# wget http://soft.vpser.net/lnmp/lnmp0.3.tar.gz<br />
# tar zxvf lnmp0.3.tar.gz<br />
# cd lnmp0.3<br />
# ./debian.sh<br />
注：需手工设置MySQL root用户的密码。</p>
<p>注：机器在防火墙中，所以使用代理安装成功：<br />
# proxychains ./debian.sh</p>
]]></content:encoded>
			<wfw:commentRss>http://liuchangjun.com/2010/03/03/lnmp-start/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Howto: 如何创建和发布自己的WordPress插件</title>
		<link>http://liuchangjun.com/2009/09/25/howto-create-wordpress-plugin/</link>
		<comments>http://liuchangjun.com/2009/09/25/howto-create-wordpress-plugin/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 08:55:17 +0000</pubDate>
		<dc:creator>star</dc:creator>
				<category><![CDATA[BLOG]]></category>
		<category><![CDATA[Tech Script]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress plugin]]></category>

		<guid isPermaLink="false">http://liuchangjun.com/?p=153</guid>
		<description><![CDATA[发布插件到官网。当插件更新时，每个安装插件的博客就可以自动更新了。]]></description>
			<content:encoded><![CDATA[<p>Refer to: <a href="http://wordpress.org/extend/plugins/about/">http://wordpress.org/extend/plugins/about/</a></p>
<p>第一步：注册插件开发的账号<br />
<a href="http://wordpress.org/extend/plugins/register.php">http://wordpress.org/extend/plugins/register.php</a><br />
注：该账号可以开发和提交插件和主题。</p>
<p>第二步：提交插件申请<br />
<a href="http://wordpress.org/extend/plugins/add/">http://wordpress.org/extend/plugins/add/</a><br />
注：因为是人工审批，一般提交后1到2天才能完成。</p>
<p>第三步：提交插件</p>
<p>任务1：提交新的插件<br />
# 创建插件目录<br />
$ mkdir my-local-dir<br />
# Check out 版本<br />
$ svn co http://svn.wp-plugins.org/your-plugin-name my-local-dir<br />
# 复制插件文件<br />
$ cd my-local-dir/<br />
my-local-dir/$ cp ~/my-plugin.php trunk/my-plugin.php<br />
my-local-dir/$ cp ~/readme.txt trunk/readme.txt<br />
# 添加文件到版本<br />
my-local-dir/$ svn add trunk/*<br />
> A	trunk/my-plugin.php<br />
> A	trunk/readme.txt<br />
# Check in 版本<br />
my-local-dir/$ svn ci -m &#8216;Adding first version of my plugin&#8217;<br />
> Adding	trunk/my-plugin.php<br />
> Adding	trunk/readme.txt<br />
> Transmitting file data .<br />
> Committed revision 11326.</p>
<p>任务2：修改插件<br />
# 更新本地版本<br />
$ cd my-local-dir/<br />
my-local-dir/$ svn up<br />
> At revision 11326.<br />
# 修改本地插件<br />
my-local-dir/$ vi trunk/my-plugin.php<br />
# 检查哪些文件修改过<br />
my-local-dir/$ svn stat<br />
> M	trunk/my-plugin.php<br />
# 检查文件修改的内容<br />
my-local-dir/$ svn diff<br />
> * What comes out is essentially the result of a<br />
  * standard `diff -u` between your local copy and the<br />
  * original copy you downloaded.<br />
# Check in 版本<br />
my-local-dir/$ svn ci -m &#8220;fancy new feature: now you can foo *and* bar at the same time&#8221;<br />
> Sending	trunk/my-plugin.php<br />
> Transmitting file data .<br />
> Committed revision 11327.</p>
<p>任务3：标记新版本<br />
# 复制最新的文件到到新版本目录<br />
my-local-dir/$ svn cp trunk tags/2.0<br />
> A tags/2.0<br />
# Check in 新版本目录<br />
my-local-dir/$ svn ci -m &#8220;tagging version 2.0&#8243;<br />
> Adding         tags/2.0<br />
> Adding         tags/2.0/my-plugin.php<br />
> Adding         tags/2.0/readme.txt<br />
> Committed revision 11328.<br />
注：如果只需要保存最新版本，可以省略这个步骤。</p>
<p>SVN链接和具体操作步骤：<br />
Wordpress plugin SVN  Link: <a href="http://plugins.svn.wordpress.org/XXX/">http://plugins.svn.wordpress.org/XXX/</a><br />
Wordpress plugin SVN  Howto: <a href="http://wordpress.org/extend/plugins/about/svn/">http://wordpress.org/extend/plugins/about/svn/</a></p>
<p>插件的说明文件需要符合标准：<br />
FAQ: <a href="http://wordpress.org/extend/plugins/about/faq/">http://wordpress.org/extend/plugins/about/faq/</a><br />
readme.txt standard: <a href="http://wordpress.org/extend/plugins/about/readme.txt">http://wordpress.org/extend/plugins/about/readme.txt</a><br />
readme.txt validator:: <a href="http://wordpress.org/extend/plugins/about/validator/">http://wordpress.org/extend/plugins/about/validator/</a><br />
注：XXX就是提交的插件名称；官网上提供插件说明文件的验证。</p>
]]></content:encoded>
			<wfw:commentRss>http://liuchangjun.com/2009/09/25/howto-create-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenVPN server install and config the bridge on Fedora 10</title>
		<link>http://liuchangjun.com/2009/06/30/openvpn-server-install-and-config-the-bridge-on-fedora-10/</link>
		<comments>http://liuchangjun.com/2009/06/30/openvpn-server-install-and-config-the-bridge-on-fedora-10/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 04:50:31 +0000</pubDate>
		<dc:creator>Liu Changjun</dc:creator>
				<category><![CDATA[Tech Script]]></category>
		<category><![CDATA[Howto]]></category>

		<guid isPermaLink="false">http://liuchangjun.com/?p=123</guid>
		<description><![CDATA[Transfered from my journal. Note: It is easy to install and config OpenVPN server on Windows XP. We should remember add the bridge (桥接) between the local network interface and the virtual network interface. Official document: OpenVPN 2.0 HOWTO Ethernet Bridging Useful document: OpenVPN&#8212;-桥接 常见问题 1.拨通vpn后ping不通vpn server的内网ip 原因：server.conf中dev 配置有问题 解决方案：将dev tap设置为dev tap0 2.各个vpn客户端之间不能互通 原因：server.conf中client-to-client配置没有打开 解决方案：将此项加入到server.conf中 [...]]]></description>
			<content:encoded><![CDATA[<p>Transfered from my journal.</p>
<p>Note: It is easy to install and config OpenVPN server on Windows XP. We should remember add the bridge (桥接) between the local network interface and the virtual network interface.</p>
<p>Official document:<br />
<a rel="nofollow" href="http://openvpn.net/howto.html" target="_blank">OpenVPN 2.0 HOWTO</a><br />
<a rel="nofollow" href="http://openvpn.net/bridge.html" target="_blank">Ethernet Bridging</a><br />
<span id="more-123"></span><br />
Useful document:<br />
<a rel="nofollow" href="http://blog.chinaunix.net/u1/46701/showart_1147730.html" target="_blank">OpenVPN&#8212;-桥接</a><br />
常见问题<br />
1.拨通vpn后ping不通vpn server的内网ip<br />
原因：server.conf中dev 配置有问题<br />
解决方案：将dev tap设置为dev tap0<br />
2.各个vpn客户端之间不能互通<br />
原因：server.conf中client-to-client配置没有打开<br />
解决方案：将此项加入到server.conf中</p>
<p>Required package:<br />
<a rel="nofollow" href="http://rpm.pbone.net/index.php3/stat/4/idpl/10414045/com/bridge-utils-1.2-6.fc10.i386.rpm.html" target="_blank">bridge-utils rpm build for : Fedora 10</a><br />
Content of RPM :<br />
/usr/sbin/brctl<br />
/usr/share/doc/bridge-utils-1.2<br />
/usr/share/doc/bridge-utils-1.2/AUTHORS<br />
/usr/share/doc/bridge-utils-1.2/COPYING<br />
/usr/share/doc/bridge-utils-1.2/FAQ<br />
/usr/share/doc/bridge-utils-1.2/HOWTO<br />
/usr/share/man/man8/brctl.8.gz</p>
<p>System environment:</p>
<p>#&gt; uname -a<br />
Linux frontend 2.6.27.5-117.fc10.i686 #1 SMP Tue Nov 18 12:19:59 EST 2008 i686 i686 i386 GNU/Linux</p>
<p>#&gt; ifconfig -a<br />
eth0      Link encap:Ethernet  HWaddr 00:13:72:40:26:7F<br />
          inet addr:10.4.3.17  Bcast:10.4.3.255  Mask:255.255.255.0<br />
          inet6 addr: fe80::213:72ff:fe40:267f/64 Scope:Link<br />
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1<br />
          RX packets:51999 errors:0 dropped:0 overruns:0 frame:0<br />
          TX packets:15652 errors:0 dropped:0 overruns:0 carrier:0<br />
          collisions:0 txqueuelen:100<br />
          RX bytes:5051569 (4.8 MiB)  TX bytes:1757669 (1.6 MiB)</p>
<p>eth1      Link encap:Ethernet  HWaddr 00:13:72:40:26:80<br />
          inet addr:192.168.100.17  Bcast:192.168.100.255  Mask:255.255.255.0<br />
          inet6 addr: fe80::213:72ff:fe40:2680/64 Scope:Link<br />
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1<br />
          RX packets:5747 errors:0 dropped:0 overruns:0 frame:0<br />
          TX packets:2340 errors:0 dropped:0 overruns:0 carrier:0<br />
          collisions:0 txqueuelen:1000<br />
          RX bytes:470066 (459.0 KiB)  TX bytes:253434 (247.4 KiB)</p>
<p>lo        Link encap:Local Loopback<br />
          inet addr:127.0.0.1  Mask:255.0.0.0<br />
          inet6 addr: ::1/128 Scope:Host<br />
          UP LOOPBACK RUNNING  MTU:16436  Metric:1<br />
          RX packets:491 errors:0 dropped:0 overruns:0 frame:0<br />
          TX packets:491 errors:0 dropped:0 overruns:0 carrier:0<br />
          collisions:0 txqueuelen:0<br />
          RX bytes:130767 (127.7 KiB)  TX bytes:130767 (127.7 KiB)</p>
<p>#&gt; route -n<br />
Kernel IP routing table<br />
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface<br />
192.168.100.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0<br />
10.4.3.0        0.0.0.0         255.255.255.0   U     0      0        0 eth1<br />
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth1<br />
169.254.0.0     0.0.0.0         255.255.0.0     U     1003   0        0 eth0<br />
192.168.0.0     192.168.100.254 255.255.0.0     UG    0      0        0 eth0<br />
0.0.0.0         10.4.3.1        0.0.0.0         UG    0      0        0 eth1</p>
<p>Installed configuration:</p>
<p>#&gt; cat /etc/rc.d/rc.local<br />
# Start OpenVPN service<br />
/etc/openvpn/bridge-start<br />
/sbin/service openvpn start<br />
# Add route<br />
route add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.100.254 eth1<br />
#route add default gw 10.4.3.1 eth0<br />
route add default gw 10.4.3.1 br0<br />
Note 1:<br />
We should add the default gateway after we started the OpenVPN server, the bridge-start script will clear the default gateway.<br />
Note2:<br />
The default route should changed to br0 not eth0 &#8211; the bridged interface.</p>
<p>#&gt; ifconfig -a<br />
br0       Link encap:Ethernet  HWaddr 00:13:72:40:26:7F<br />
          inet addr:10.4.3.17  Bcast:10.4.3.255  Mask:255.255.255.0<br />
          inet6 addr: fe80::213:72ff:fe40:267f/64 Scope:Link<br />
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1<br />
          RX packets:48639 errors:0 dropped:0 overruns:0 frame:0<br />
          TX packets:15365 errors:0 dropped:0 overruns:0 carrier:0<br />
          collisions:0 txqueuelen:0<br />
          RX bytes:4152487 (3.9 MiB)  TX bytes:1727401 (1.6 MiB)</p>
<p>eth0      Link encap:Ethernet  HWaddr 00:13:72:40:26:7F<br />
          inet addr:10.4.3.17  Bcast:10.4.3.255  Mask:255.255.255.0<br />
          inet6 addr: fe80::213:72ff:fe40:267f/64 Scope:Link<br />
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1<br />
          RX packets:51999 errors:0 dropped:0 overruns:0 frame:0<br />
          TX packets:15652 errors:0 dropped:0 overruns:0 carrier:0<br />
          collisions:0 txqueuelen:100<br />
          RX bytes:5051569 (4.8 MiB)  TX bytes:1757669 (1.6 MiB)</p>
<p>eth1      Link encap:Ethernet  HWaddr 00:13:72:40:26:80<br />
          inet addr:192.168.100.17  Bcast:192.168.100.255  Mask:255.255.255.0<br />
          inet6 addr: fe80::213:72ff:fe40:2680/64 Scope:Link<br />
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1<br />
          RX packets:5747 errors:0 dropped:0 overruns:0 frame:0<br />
          TX packets:2340 errors:0 dropped:0 overruns:0 carrier:0<br />
          collisions:0 txqueuelen:1000<br />
          RX bytes:470066 (459.0 KiB)  TX bytes:253434 (247.4 KiB)</p>
<p>lo        Link encap:Local Loopback<br />
          inet addr:127.0.0.1  Mask:255.0.0.0<br />
          inet6 addr: ::1/128 Scope:Host<br />
          UP LOOPBACK RUNNING  MTU:16436  Metric:1<br />
          RX packets:491 errors:0 dropped:0 overruns:0 frame:0<br />
          TX packets:491 errors:0 dropped:0 overruns:0 carrier:0<br />
          collisions:0 txqueuelen:0<br />
          RX bytes:130767 (127.7 KiB)  TX bytes:130767 (127.7 KiB)</p>
<p>tap0      Link encap:Ethernet  HWaddr AE:11:02:37:F7:88<br />
          inet6 addr: fe80::ac11:2ff:fe37:f788/64 Scope:Link<br />
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1<br />
          RX packets:301 errors:0 dropped:0 overruns:0 frame:0<br />
          TX packets:34402 errors:0 dropped:17 overruns:0 carrier:0<br />
          collisions:0 txqueuelen:100<br />
          RX bytes:30484 (29.7 KiB)  TX bytes:3010000 (2.8 MiB)</p>
<p>#&gt; route -n<br />
Kernel IP routing table<br />
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface<br />
192.168.100.0   0.0.0.0         255.255.255.0   U     0      0        0 eth1<br />
10.4.3.0        0.0.0.0         255.255.255.0   U     0      0        0 br0<br />
10.4.3.0        0.0.0.0         255.255.255.0   U     0      0        0 eth0<br />
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0<br />
169.254.0.0     0.0.0.0         255.255.0.0     U     1003   0        0 eth1<br />
192.168.0.0     192.168.100.254 255.255.0.0     UG    0      0        0 eth1<br />
0.0.0.0         10.4.3.1        0.0.0.0         UG    0      0        0 br0</p>
<p>#&gt; ls /etc/openvpn<br />
bridge-start  sample-keys<br />
bridge-stop   server.conf</p>
<p>#&gt; cat /etc/openvpn/bridge-start<br />
#!/bin/bash</p>
<p>#################################<br />
# Set up Ethernet bridge on Linux<br />
# Requires: bridge-utils<br />
#################################</p>
<p># Define Bridge Interface<br />
br=&#8221;br0&#8243;</p>
<p># Define list of TAP interfaces to be bridged,<br />
# for example tap=&#8221;tap0 tap1 tap2&#8243;.<br />
tap=&#8221;tap0&#8243;</p>
<p># Define physical ethernet interface to be bridged<br />
# with TAP interface(s) above.<br />
eth=&#8221;eth0&#8243;<br />
eth_ip=&#8221;10.4.3.17&#8243;<br />
eth_netmask=&#8221;255.255.255.0&#8243;<br />
eth_broadcast=&#8221;10.4.3.255&#8243;</p>
<p>for t in $tap; do<br />
    openvpn &#8211;mktun &#8211;dev $t<br />
done</p>
<p>brctl addbr $br<br />
brctl addif $br $eth</p>
<p>for t in $tap; do<br />
    brctl addif $br $t<br />
done</p>
<p>for t in $tap; do<br />
    ifconfig $t 0.0.0.0 promisc up<br />
done</p>
<p>ifconfig $eth 0.0.0.0 promisc up</p>
<p>ifconfig $br $eth_ip netmask $eth_netmask broadcast $eth_broadcast</p>
<p>#&gt; cat /etc/openvpn/bridge-stop<br />
#!/bin/bash</p>
<p>####################################<br />
# Tear Down Ethernet bridge on Linux<br />
####################################</p>
<p># Define Bridge Interface<br />
br=&#8221;br0&#8243;</p>
<p># Define list of TAP interfaces to be bridged together<br />
tap=&#8221;tap0&#8243;</p>
<p>ifconfig $br down<br />
brctl delbr $br</p>
<p>for t in $tap; do<br />
    openvpn &#8211;rmtun &#8211;dev $t<br />
done</p>
<p>#&gt; cat /etc/openvpn/server.conf<br />
#################################################<br />
# Sample OpenVPN 2.0 config file for            #<br />
# multi-client server.                          #<br />
#                                               #<br />
# This file is for the server side              #<br />
# of a many-clients &lt;-&gt; one-server              #<br />
# OpenVPN configuration.                        #<br />
#                                               #<br />
# OpenVPN also supports                         #<br />
# single-machine &lt;-&gt; single-machine             #<br />
# configurations (See the Examples page         #<br />
# on the web site for more info).               #<br />
#                                               #<br />
# This config should work on Windows            #<br />
# or Linux/BSD systems.  Remember on            #<br />
# Windows to quote pathnames and use            #<br />
# double backslashes, e.g.:                     #<br />
# &#8220;C:\\Program Files\\OpenVPN\\config\\foo.key&#8221; #<br />
#                                               #<br />
# Comments are preceded with &#8216;#&#8217; or &#8216;;&#8217;         #<br />
#################################################</p>
<p># Which local IP address should OpenVPN<br />
# listen on? (optional)<br />
;local a.b.c.d</p>
<p># Which TCP/UDP port should OpenVPN listen on?<br />
# If you want to run multiple OpenVPN instances<br />
# on the same machine, use a different port<br />
# number for each one.  You will need to<br />
# open up this port on your firewall.<br />
port 1194<br />
;port 5000</p>
<p># TCP or UDP server?<br />
;proto tcp<br />
proto udp</p>
<p># &#8220;dev tun&#8221; will create a routed IP tunnel,<br />
# &#8220;dev tap&#8221; will create an ethernet tunnel.<br />
# Use &#8220;dev tap0&#8243; if you are ethernet bridging<br />
# and have precreated a tap0 virtual interface<br />
# and bridged it with your ethernet interface.<br />
# If you want to control access policies<br />
# over the VPN, you must create firewall<br />
# rules for the the TUN/TAP interface.<br />
# On non-Windows systems, you can give<br />
# an explicit unit number, such as tun0.<br />
# On Windows, use &#8220;dev-node&#8221; for this.<br />
# On most systems, the VPN will not function<br />
# unless you partially or fully disable<br />
# the firewall for the TUN/TAP interface.<br />
dev tap0<br />
;dev tun</p>
<p># Windows needs the TAP-Win32 adapter name<br />
# from the Network Connections panel if you<br />
# have more than one.  On XP SP2 or higher,<br />
# you may need to selectively disable the<br />
# Windows firewall for the TAP adapter.<br />
# Non-Windows systems usually don&#8217;t need this.<br />
;dev-node MyTap</p>
<p># SSL/TLS root certificate (ca), certificate<br />
# (cert), and private key (key).  Each client<br />
# and the server must have their own cert and<br />
# key file.  The server and all clients will<br />
# use the same ca file.<br />
#<br />
# See the &#8220;easy-rsa&#8221; directory for a series<br />
# of scripts for generating RSA certificates<br />
# and private keys.  Remember to use<br />
# a unique Common Name for the server<br />
# and each of the client certificates.<br />
#<br />
# Any X509 key management system can be used.<br />
# OpenVPN can also use a PKCS #12 formatted key file<br />
# (see &#8220;pkcs12&#8243; directive in man page).<br />
ca sample-keys/tmp-ca.crt<br />
cert sample-keys/server.crt<br />
key sample-keys/server.key  # This file should be kept secret</p>
<p># Diffie hellman parameters.<br />
# Generate your own with:<br />
#   openssl dhparam -out dh1024.pem 1024<br />
# Substitute 2048 for 1024 if you are using<br />
# 2048 bit keys.<br />
dh sample-keys/dh1024.pem</p>
<p># Configure server mode and supply a VPN subnet<br />
# for OpenVPN to draw client addresses from.<br />
# The server will take 10.8.0.1 for itself,<br />
# the rest will be made available to clients.<br />
# Each client will be able to reach the server<br />
# on 10.8.0.1. Comment this line out if you are<br />
# ethernet bridging. See the man page for more info.<br />
;server 10.8.0.0 255.255.255.0</p>
<p># Maintain a record of client &lt;-&gt; virtual IP address<br />
# associations in this file.  If OpenVPN goes down or<br />
# is restarted, reconnecting clients can be assigned<br />
# the same virtual IP address from the pool that was<br />
# previously assigned.<br />
;ifconfig-pool-persist ipp.txt</p>
<p># Configure server mode for ethernet bridging.<br />
# You must first use your OS&#8217;s bridging capability<br />
# to bridge the TAP interface with the ethernet<br />
# NIC interface.  Then you must manually set the<br />
# IP/netmask on the bridge interface, here we<br />
# assume 10.8.0.4/255.255.255.0.  Finally we<br />
# must set aside an IP range in this subnet<br />
# (start=10.8.0.50 end=10.8.0.100) to allocate<br />
# to connecting clients.  Leave this line commented<br />
# out unless you are ethernet bridging.<br />
;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100<br />
server-bridge 10.4.3.17 255.255.0.0 10.4.3.221 10.4.3.230</p>
<p># Push routes to the client to allow it<br />
# to reach other private subnets behind<br />
# the server.  Remember that these<br />
# private subnets will also need<br />
# to know to route the OpenVPN client<br />
# address pool (10.8.0.0/255.255.255.0)<br />
# back to the OpenVPN server.<br />
;push &#8220;route 192.168.10.0 255.255.255.0&#8243;<br />
;push &#8220;route 192.168.20.0 255.255.255.0&#8243;<br />
push &#8220;route 10.4.0.0 255.255.0.0 10.4.3.1&#8243;</p>
<p># To assign specific IP addresses to specific<br />
# clients or if a connecting client has a private<br />
# subnet behind it that should also have VPN access,<br />
# use the subdirectory &#8220;ccd&#8221; for client-specific<br />
# configuration files (see man page for more info).</p>
<p># EXAMPLE: Suppose the client<br />
# having the certificate common name &#8220;Thelonious&#8221;<br />
# also has a small subnet behind his connecting<br />
# machine, such as 192.168.40.128/255.255.255.248.<br />
# First, uncomment out these lines:<br />
;client-config-dir ccd<br />
;route 192.168.40.128 255.255.255.248<br />
# Then create a file ccd/Thelonious with this line:<br />
#   iroute 192.168.40.128 255.255.255.248<br />
# This will allow Thelonious&#8217; private subnet to<br />
# access the VPN.  This example will only work<br />
# if you are routing, not bridging, i.e. you are<br />
# using &#8220;dev tun&#8221; and &#8220;server&#8221; directives.</p>
<p># EXAMPLE: Suppose you want to give<br />
# Thelonious a fixed VPN IP address of 10.9.0.1.<br />
# First uncomment out these lines:<br />
;client-config-dir ccd<br />
;route 10.9.0.0 255.255.255.252<br />
# Then add this line to ccd/Thelonious:<br />
#   ifconfig-push 10.9.0.1 10.9.0.2</p>
<p># Suppose that you want to enable different<br />
# firewall access policies for different groups<br />
# of clients.  There are two methods:<br />
# (1) Run multiple OpenVPN daemons, one for each<br />
#     group, and firewall the TUN/TAP interface<br />
#     for each group/daemon appropriately.<br />
# (2) (Advanced) Create a script to dynamically<br />
#     modify the firewall in response to access<br />
#     from different clients.  See man<br />
#     page for more info on learn-address script.<br />
;learn-address ./script</p>
<p># If enabled, this directive will configure<br />
# all clients to redirect their default<br />
# network gateway through the VPN, causing<br />
# all IP traffic such as web browsing and<br />
# and DNS lookups to go through the VPN<br />
# (The OpenVPN server machine may need to NAT<br />
# the TUN/TAP interface to the internet in<br />
# order for this to work properly).<br />
# CAVEAT: May break client&#8217;s network config if<br />
# client&#8217;s local DHCP server packets get routed<br />
# through the tunnel.  Solution: make sure<br />
# client&#8217;s local DHCP server is reachable via<br />
# a more specific route than the default route<br />
# of 0.0.0.0/0.0.0.0.<br />
;push &#8220;redirect-gateway&#8221;</p>
<p># Certain Windows-specific network settings<br />
# can be pushed to clients, such as DNS<br />
# or WINS server addresses.  CAVEAT:<br />
# <a rel="nofollow" href="http://openvpn.net/faq.html#dhcpcaveats" target="_blank">http://openvpn.net/faq.html#dhcpcaveats</a><br />
;push &#8220;dhcp-option DNS 10.8.0.1&#8243;<br />
;push &#8220;dhcp-option WINS 10.8.0.1&#8243;</p>
<p># Uncomment this directive to allow different<br />
# clients to be able to &#8220;see&#8221; each other.<br />
# By default, clients will only see the server.<br />
# To force clients to only see the server, you<br />
# will also need to appropriately firewall the<br />
# server&#8217;s TUN/TAP interface.<br />
;client-to-client<br />
client-to-client</p>
<p># Uncomment this directive if multiple clients<br />
# might connect with the same certificate/key<br />
# files or common names.  This is recommended<br />
# only for testing purposes.  For production use,<br />
# each client should have its own certificate/key<br />
# pair.<br />
#<br />
# IF YOU HAVE NOT GENERATED INDIVIDUAL<br />
# CERTIFICATE/KEY PAIRS FOR EACH CLIENT,<br />
# EACH HAVING ITS OWN UNIQUE &#8220;COMMON NAME&#8221;,<br />
# UNCOMMENT THIS LINE OUT.<br />
;duplicate-cn<br />
duplicate-cn</p>
<p># The keepalive directive causes ping-like<br />
# messages to be sent back and forth over<br />
# the link so that each side knows when<br />
# the other side has gone down.<br />
# Ping every 10 seconds, assume that remote<br />
# peer is down if no ping received during<br />
# a 120 second time period.<br />
keepalive 10 120</p>
<p># For extra security beyond that provided<br />
# by SSL/TLS, create an &#8220;HMAC firewall&#8221;<br />
# to help block DoS attacks and UDP port flooding.<br />
#<br />
# Generate with:<br />
#   openvpn &#8211;genkey &#8211;secret ta.key<br />
#<br />
# The server and each client must have<br />
# a copy of this key.<br />
# The second parameter should be &#8217;0&#8242;<br />
# on the server and &#8217;1&#8242; on the clients.<br />
;tls-auth ta.key 0 # This file is secret</p>
<p># Select a cryptographic cipher.<br />
# This config item must be copied to<br />
# the client config file as well.<br />
;cipher BF-CBC        # Blowfish (default)<br />
;cipher AES-128-CBC   # AES<br />
;cipher DES-EDE3-CBC  # Triple-DES</p>
<p># Enable compression on the VPN link.<br />
# If you enable it here, you must also<br />
# enable it in the client config file.<br />
comp-lzo</p>
<p># The maximum number of concurrently connected<br />
# clients we want to allow.<br />
;max-clients 100</p>
<p># It&#8217;s a good idea to reduce the OpenVPN<br />
# daemon&#8217;s privileges after initialization.<br />
#<br />
# You can uncomment this out on<br />
# non-Windows systems.<br />
user nobody<br />
group nobody</p>
<p># The persist options will try to avoid<br />
# accessing certain resources on restart<br />
# that may no longer be accessible because<br />
# of the privilege downgrade.<br />
persist-key<br />
persist-tun</p>
<p># Output a short status file showing<br />
# current connections, truncated<br />
# and rewritten every minute.<br />
status openvpn-status.log</p>
<p># By default, log messages will go to the syslog (or<br />
# on Windows, if running as a service, they will go to<br />
# the &#8220;\Program Files\OpenVPN\log&#8221; directory).<br />
# Use log or log-append to override this default.<br />
# &#8220;log&#8221; will truncate the log file on OpenVPN startup,<br />
# while &#8220;log-append&#8221; will append to it.  Use one<br />
# or the other (but not both).<br />
;log         openvpn.log<br />
;log-append  openvpn.log</p>
<p># Set the appropriate level of log<br />
# file verbosity.<br />
#<br />
# 0 is silent, except for fatal errors<br />
# 4 is reasonable for general usage<br />
# 5 and 6 can help to debug connection problems<br />
# 9 is extremely verbose<br />
verb 4</p>
<p># Silence repeating messages.  At most 20<br />
# sequential messages of the same message<br />
# category will be output to the log.<br />
;mute 20</p>
]]></content:encoded>
			<wfw:commentRss>http://liuchangjun.com/2009/06/30/openvpn-server-install-and-config-the-bridge-on-fedora-10/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sun Solaris 10 Jumpstart installation</title>
		<link>http://liuchangjun.com/2009/06/30/sun-solaris-10-jumpstart-installation/</link>
		<comments>http://liuchangjun.com/2009/06/30/sun-solaris-10-jumpstart-installation/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 04:49:35 +0000</pubDate>
		<dc:creator>Liu Changjun</dc:creator>
				<category><![CDATA[Tech Script]]></category>
		<category><![CDATA[Howto]]></category>

		<guid isPermaLink="false">http://liuchangjun.com/?p=121</guid>
		<description><![CDATA[Transfered from my journal. Sun installation document: 820-5239 &#60;&#60;Solaris 10 10/08 Installation Guide: CustomJumpStart and Advanced Installations&#62;&#62; 820-5237 &#60;&#60;Solaris 10 10/08 Installation Guide:Network-Based Installations&#62;&#62; Create installation directory: CD 1 #&#62; /cdrom/s0/Solaris_10/Tools/setup_install_server /export/install10 CD 2-5 #&#62; /cdrom/Solaris_10/Tools/add_to_install_server /export/install10 Solaris 10 patch #&#62; unzip /export/install10/patchdb/5.10/sparc/10_Recommended.zip Update /etc/hosts 192.168.1.45 autotest Update /etc/ethers 0:17:4f:0f:42:b0 autotest Update /etc/dfs/dfstab share -F [...]]]></description>
			<content:encoded><![CDATA[<p>Transfered from my journal.</p>
<p>Sun installation document:<br />
820-5239<br />
&lt;&lt;Solaris 10 10/08 Installation Guide: CustomJumpStart and Advanced Installations&gt;&gt;<br />
820-5237<br />
&lt;&lt;Solaris 10 10/08 Installation Guide:Network-Based Installations&gt;&gt;<br />
<span id="more-121"></span><br />
Create installation directory:<br />
CD 1<br />
#&gt; /cdrom/s0/Solaris_10/Tools/setup_install_server  /export/install10<br />
CD 2-5<br />
#&gt; /cdrom/Solaris_10/Tools/add_to_install_server /export/install10<br />
Solaris 10 patch<br />
#&gt; unzip /export/install10/patchdb/5.10/sparc/10_Recommended.zip</p>
<p>Update /etc/hosts<br />
192.168.1.45   autotest</p>
<p>Update /etc/ethers<br />
0:17:4f:0f:42:b0 autotest</p>
<p>Update /etc/dfs/dfstab<br />
share -F nfs -o ro,anon=0 /jstart<br />
share -F nfs -o ro,anon=0 /export/install10<br />
#&gt; shareall<br />
#&gt; /etc/init.d/nfs.server stop|start</p>
<p>Update Jumpstart config file<br />
cp –pr /export/install10/Solaris_10/Misc/jumpstart_sample /jstart</p>
<p>Update /jstart/sysidcfg<br />
keyboard=English<br />
system_locale=en_US<br />
timezone=US/Central<br />
terminal=vt100<br />
timeserver=localhost<br />
name_service=none<br />
nfs4_domain=dynamic<br />
root_password=IbIPT4W6ebNWc<br />
network_interface=primary<br />
{<br />
default_route=10.4.3.1<br />
netmask=255.255.255.0<br />
protocol_ipv6=no<br />
}<br />
security_policy=none<br />
service_profile=open</p>
<p>Update /jstart/rules<br />
hostname cbtmsu1   &#8211;   any_machine.280  10recommended</p>
<p>Update /jstart/any_machine.280<br />
install_type    initial_install<br />
system_type     server<br />
partitioning    explicit<br />
filesys         c1t0d0s0 2048    swap<br />
filesys         c1t0d0s1 free    /</p>
<p>Check the Jumpstart config<br />
#&gt; /jstart/check</p>
<p>Update /jstart/10recommended<br />
LUPATCHHOST=10.4.3.250<br />
LUPATCHPATHROOT=/export/install10/patchdb</p>
<p>Update client<br />
#&gt; /export/install10/Solaris_10/Tools/add_install_client -s 10.4.3.250:/export/install10 -c 10.4.3.250:/jstart -p 10.4.3.250:/jstart autotest sun4u<br />
/etc/bootparams will be updated<br />
autotest  root=vgtui_1:/export/install10/Solaris_10/Tools/Boot install=10.4.3.250:/export/install10 boottype=:in sysid_config=10.4.3.250:/jstart install_config=10.4.3.250:/jstart rootopts=:rsize=8192 </p>
<p>Install client<br />
ok boot net &#8211; install</p>
<p>　　== 准备jumpstart ==<br />
　　开始jumpstart之前，需要做以下准备：<br />
　　# 了解jumpstart基本知识，请google一下 &lt;br&gt;<br />
　　# 我们实验室已经建好了jumpstart server，通过frontend可以直接访问，hostname/usr/password: jstart/root/voip &lt;br&gt;<br />
　　# 了解jumpstart目标机器（也就是待安装机器），通过ifconfig -a获得其一个网卡物理地址并记录下来，安装时网线必须连接此网口，暂时称此网口为jumpstart网口 &lt;br&gt;<br />
　　# 将jstart的第一个网口（已经配置好专用于jumpstart）和目标机器的jumpstart网口连接到一个独立的hub上去，这样它们将位于一个独立的网络，jumpstart安装时目标机器需要通过广播包从jstart获得其IP地址然后进行下一步操作 &lt;br&gt;</p>
<p>　　== 配置jumpstart server ==<br />
　　=== 设置hosts和ethers ===<br />
　　# hosts中为目标机器选择一个IP地址和机器名称 &lt;br&gt;<br />
　　# ethers中则是指定目标地址的网卡物理地址，也就是上面记录的jumpstart网口对应的网卡物理地址 &lt;br&gt;</p>
<p>　　=== jumpstart专用配置 ===<br />
　　jstart上有一个jumpstart专用目录：/jstart &lt;br&gt;<br />
　　需要设置以下3个jumpstart配置文件： &lt;br&gt;<br />
　　# rules。注意：设置完此文件后需要运行一下./check &lt;br&gt;<br />
　　# any_machine.xxx。你会发现/jstart目录下有很多any_machine.大头的文件，文件的后缀名则是服务器种类，这类文件都是用来设置安装时目标机器分区用的，一般来说对于已有的服务器种类不需要再修改其any_machine文件，只需要在后面引用即可 &lt;br&gt;<br />
　　# client_dev.sh。这个shell脚本的主要作用是设置tftp，tftp是jumpstart安装时目标机器从jumpstart server下载文件用的，配置完后运行一下./client_dev.sh。 &lt;br&gt;</p>
<p>　　注意： &lt;br&gt;<br />
　　以上配置完成之后，需要检查以下几个地方： &lt;br&gt;<br />
　　# /etc/ethers &lt;br&gt;<br />
　　# /etc/inet/hosts &lt;br&gt;<br />
　　# /tftpboot（目录），检查rm.xxx中有没有对应目标机器的配置文件 &lt;br&gt;<br />
　　# /etc/inet/inetd.conf （见案例2） &lt;br&gt;<br />
　　# /etc/bootparams （见案例1） &lt;br&gt;<br />
　　# /etc/dfs/dfstab &lt;br&gt;</p>
<p>　　== 开始安装 ==<br />
　　步骤如下： &lt;br&gt;<br />
　　# 串口连接目标机器，运行init 0进入standalone无网络ok状态 &lt;br&gt;<br />
　　# 在ok提示状态下运行boot net &#8211; install &lt;br&gt;<br />
　　之后所有的安装将自动进行 &lt;br&gt; </p>
<p>FAQ:</p>
<p>=== 案例1 ===<br />
某次jumpstart solaris 10时下载完安装包后便报以下错误： &lt;br&gt;<br />
 Completed software installation</p>
<p> Solaris 9 software installation succeeded</p>
<p> Customizing system files<br />
         &#8211; Mount points table (/etc/vfstab)<br />
         &#8211; Network host addresses (/etc/hosts)<br />
         &#8211; Network host addresses (/etc/hosts)<br />
 WARNING: Could not set file attributes (/a/var/svc/profile/name_service.xml)</p>
<p> ERROR: Unable to copy a temporary file to it&#8217;s final location</p>
<p> ERROR: System installation failed<br />
 Solaris installation program exited.<br />
检查/etc/bootparams文件后发现是client_dev.sh中的安装包路径搞错了 &lt;br&gt;</p>
<p>=== 案例2 ===<br />
某次jumpstart时下载不了安装包，注：可以在jstart上snoop -v监控jumpstart安装过程的IP包 &lt;br&gt;<br />
最后检查/etc/inetd.conf配置发现tftp中启用了udp6所致，应该为如下配置： &lt;br&gt;<br />
 tftp    dgram   udp     wait    root    /usr/sbin/in.tftpd      in.tftpd -s /tftpboot</p>
<p>=== 案例3 ===<br />
某次jumpstart时发现，目标地址第一步动作——从jumpstart获取IP地址——失败，而snoop -v能够抓到目标机器的广播包。 &lt;br&gt;<br />
检查/etc/ethers文件发现有重复的物理地址，去掉之后就正常了。&lt;br&gt;<br />
&lt;br&gt;<br />
也有几次get IP地址失败竟然是因为插在hub上的网线松了。&lt;br&gt;</p>
<p>=== 案例4 ===<br />
有台机器的首个网口坏掉了，可以用以下方法jumpstart：&lt;br&gt;<br />
 ok devalias<br />
此命令能够列出所有设备，可以发现有多个网络设备，它们的命名方式一般是net, net1, net2, net3 &lt;br&gt;<br />
 ok boot net1 &#8211; install<br />
从net1（也就是第二个网口）启动并开始jumpstart</p>
<p>=== 案例5 ===<br />
ok boot net &#8211; install<br />
Boot device:  /pci@1f,0/pci@1,1/network@c,1  File and args: &#8211; install<br />
SunOS Release  5.10 Version Generic_118833-17 64-bit<br />
Copyright 1983-2005 Sun Microsystems,  Inc.  All rights reserved.<br />
Use is subject to license  terms.<br />
SUNW,eri0 : 100 Mbps full duplex link up<br />
whoami: no domain  name<br />
Configuring devices.<br />
Using RPC Bootparams for network configuration  information.<br />
Attempting to configure interface eri1&#8230;<br />
Skipped interface  eri1<br />
Attempting to configure interface eri0&#8230;<br />
Configured interface  eri0<br />
Beginning system identification&#8230;<br />
Searching for configuration  file(s)&#8230;<br />
Using sysid configuration file  10.4.3.250:/jumpstart/sysidcfg<br />
Search complete.<br />
Discovering additional  network configuration&#8230;<br />
Completing system identification&#8230;<br />
Starting  remote procedure call (RPC) services: done.<br />
System identification  complete.<br />
Starting Solaris installation program&#8230;<br />
Searching for JumpStart directory&#8230;<br />
not found<br />
Warning:  Could not find matching rule in rules.ok<br />
Press the return key for an  interactive Solaris install  program&#8230;<br />
已解决：<br />
修改/etc/netmasks，使所有的netmask保持一致。<br />
 a. /etc/netmasks；<br />
 b. sysidcfg中网络接口的配置；<br />
 c. /export/install10/Solaris_10/Tools/Boot/netmask<br />
 d. #ifconfig -a； &#8212;- 你的目标网卡设置的掩码是255.0.0.0，而其他几个的设置为255.255.255.0<br />
 bge1: flags=1000843&lt;UP,BROADCAST,RUNNING,MULTICAST,IPv4&gt; mtu 1500 index 3<br />
        inet 10.4.3.250 netmask ff000000 broadcast 10.255.255.255<br />
        ether 0:3:ba:9f:f7:d6</p>
]]></content:encoded>
			<wfw:commentRss>http://liuchangjun.com/2009/06/30/sun-solaris-10-jumpstart-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SUN Netra-T1 LOM Usage</title>
		<link>http://liuchangjun.com/2009/06/30/sun-netra-t1-lom-usage/</link>
		<comments>http://liuchangjun.com/2009/06/30/sun-netra-t1-lom-usage/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 04:47:30 +0000</pubDate>
		<dc:creator>Liu Changjun</dc:creator>
				<category><![CDATA[Tech Script]]></category>
		<category><![CDATA[Howto]]></category>

		<guid isPermaLink="false">http://liuchangjun.com/?p=119</guid>
		<description><![CDATA[Transfered from my journal. Netra-T1 AC200 LOM Usage (SunSolve Document ID 40507, Date 17 Oct 2001) http://www.aaven.com/UNIX/Solaris/lom_commands.asp lom =&#62; ok lom&#62; bootmode reset_nvram lom&#62; power / reset ok =&#62; # ok boot net &#8211; install # =&#62; lom #&#62; #. There are three prompts available on the Netra-t1. ok&#62; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; (normal prompt when the OS [...]]]></description>
			<content:encoded><![CDATA[<p>Transfered from my journal.</p>
<p>Netra-T1 AC200 LOM Usage (SunSolve Document ID 40507, Date 17 Oct 2001)<br />
<a rel="nofollow" href="http://www.aaven.com/UNIX/Solaris/lom_commands.asp" target="_blank">http://www.aaven.com/UNIX/Solaris/lom_commands.asp</a></p>
<p>lom =&gt; ok<br />
lom&gt; bootmode reset_nvram<br />
lom&gt; power / reset</p>
<p>ok =&gt; #<br />
ok boot net &#8211; install</p>
<p># =&gt; lom<br />
#&gt; #.<br />
<span id="more-119"></span><br />
There are three prompts available on the Netra-t1.<br />
  ok&gt;   &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; (normal prompt when the OS is not running)<br />
  lom&gt;  &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; (available whether OS is running or not)<br />
  #     &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; (the OS prompt)</p>
<p>To move between the &#8220;ok&gt;&#8221; prompt and the &#8220;lom&gt;&#8221; prompt, type:<br />
  ok&gt; #.      There must be less than 1 second between the &#8220;#&#8221; and &#8220;.&#8221;<br />
  lom&gt;        &#8212;&#8212;&gt;      This is the prompt you get</p>
<p>  Root can change this character sequence:<br />
    # lomctl &lt;new first character&gt;</p>
<p>    Only the first character (&#8220;#&#8221;) can be changed. You don&#8217;t need<br />
    to know the previous character to do this.</p>
<p>  To find out the current sequence do an &#8220;init 5&#8243;:<br />
    # init 5<br />
    This shuts down the system and gives you the &#8220;lom&gt;&#8221; prompt</p>
<p>  Then to show the current two-character sequence type:<br />
    lom&gt; show escape</p>
<p>To move between the &#8220;lom&gt;&#8221; prompt and the &#8220;ok&gt;&#8221; prompt type:<br />
  lom&gt; console</p>
<p>See Infodoc 27372 for a flow chart of how to jump around between the &#8220;lom&gt;&#8221;,<br />
&#8220;ok&gt;&#8221; and &#8220;OS&#8221; prompts.</p>
<p>Some useful lom&gt; commands are:</p>
<p>lom&gt; poweron &#8212;&#8212;&#8212;&#8212;- (powers on the netra)<br />
lom&gt; poweroff &#8212;&#8212;&#8212;&#8212; (powers off the netra)<br />
lom&gt; reset &#8212;&#8212;&#8212;&#8212;&#8212; (the same as the ok&gt; reset command)<br />
lom&gt; reset -x &#8212;&#8212;&#8212;&#8212; (resets the CPU only- externally initiated<br />
                           reset XIR)<br />
lom&gt; break &#8212;&#8212;&#8212;&#8212;&#8212; (goes to the ok&gt; prompt from the OS- &#8220;Stop-a&#8221;)<br />
lom&gt; environment &#8212;&#8212;&#8212; (current status of all components in system)<br />
lom&gt; check &#8212;&#8212;&#8212;&#8212;&#8212; (updates component status after repairing it-<br />
                           run &#8220;lom&gt; environment&#8221; again)<br />
lom&gt; show eventlog &#8212;&#8212;- (show last 10 events on the system)<br />
lom&gt; set faulton &#8212;&#8212;&#8212; (turns on the fault LED)<br />
lom&gt; set faultoff &#8212;&#8212;&#8211; (turns off the fault LED)<br />
lom&gt; set alarmon [1-3] &#8212; (sets 1 of 3 alarms on)<br />
lom&gt; set alarmoff [1-3] &#8212; (sets 1 of 3 alarms off)<br />
lom&gt; show model &#8212;&#8212;&#8212;- (show the server model)<br />
lom&gt; show hostname &#8212;&#8212;- (same as uname -n)<br />
lom&gt; show &#8212;&#8212;&#8212;&#8212;&#8212;- (help for the &#8220;show&#8221; command)<br />
lom&gt; help &#8212;&#8212;&#8212;&#8212;&#8212;- (list of LOM commands)      </p>
<p>You can set the boot mode of a netra using the below &#8220;lom&gt;&#8221; command:</p>
<p>  lom&gt; bootmode [-u][normal|forth|reset_nvram|diag|skip_diag]</p>
<p>        -u      allows sharing of the console and LOM device</p>
<p>        normal  server boots using the OBP environment settings<br />
                -must reset server to take effect</p>
<p>        forth   server stops at the &#8220;ok&gt;&#8221; prompt- same as &#8220;Stop-f&#8221;<br />
                -must reset server to take effect</p>
<p>        reset_nvram -&#8221;ok&gt; set-defaults&#8221; or &#8220;Stop-n&#8221;<br />
                -must reset server to take effect</p>
<p>        diag    runs full POST- &#8220;ok&gt; diag-switch? true&#8221; or &#8220;Stop-d&#8221;<br />
                -must power off server and back on within 10 minutes</p>
<p>        skip_diag &#8211; ok&gt; setenv diag-switch? false&#8221;<br />
                -must power off server and back on within 10 minutes</p>
<p>Also see related Infodocs:</p>
<p>27372 How do I jump to LOM prompt on the the Netra T?<br />
26009 Installing the Netra T1 Model AC200 or DC200 from cdrom using<br />
      Solaris 8 Update 2 (10/00) or Solaris 8 Update 3 (01/01)<br />
26310 Reinstalling Solaris 8 on the Netra X1 including LOM (Lights<br />
      out Management) packages<br />
26667 Connecting a serial cable from a Netra T1 AC/DC200 server to<br />
      a laptop</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Complete List of Commands<br />
Command      Effect<br />
alarmoff n      Set alarm n off.<br />
(Where n is 1, 2, or 3.) These three alarms are software flags. They are associated with no specific conditions but are available to be set by your own processes.<br />
alarmon n      Set alarm n on.<br />
(Where n is 1, 2, or 3.)  These three alarms are software flags.  They are associated with no specific conditions but are available to be set by your own processes.<br />
break      Takes the server down to the OK prompt.<br />
bootmode mode      Determines the behavior of the server during the boot process.<br />
check      Resets monitoring to report all failures.<br />
If a monitored component has failed, the LOMlite2 device will not continue to report the same failure.  To check the status of the component, for example, after attempting to fix it, issue the check command.  This updates the status of all monitored components.<br />
console      The command takes you out of the LOMlite2 shell and back to the Solaris prompt.  It returns control of the serial connection to the console.<br />
environment      Displays the temperature of the server and the status of the fans, the power supply, the over-temperature monitors, the supply rails and circuit breakers, the alarms, and the fault LED.<br />
faulton      Sets the Fault LED to On.<br />
faultoff      Sets the Fault LED to Off.<br />
help      Displays the list of LOM commands.<br />
loghistory      Displays all the events in the LOMlite2 device&#8217;s Event Log.<br />
logout      This command is for use by named users you have set up with password access to the LOMlite2 device.  It returns them to the LOM user login prompt.<br />
poweron      Powers the server On.<br />
poweroff      Powers the server Off.<br />
reset      Resets the Netra T1 server.<br />
show model      Displays the server model.<br />
show hostname      Displays the server name (this command is equivalent to the Solaris uname -n command.<br />
show eventlog      Displays the LOMlite2 device&#8217;s event log.<br />
The event log is the list of the last 10 events to have been stored in the LOMlite2 device.  The most recent event is the one at the bottom of the list.<br />
show escape      Displays the current LOMlite2 escape sequence.<br />
show      Displays all the information available with the show command.<br />
useradd      Adds a user to the LOMlite2 device&#8217;s list of permitted users.<br />
userdel      Deletes a user to the LOMlite2 device&#8217;s list of permitted users.<br />
usershow user      Displays the details for the LOMlite2 account user.<br />
userpassword      Sets or changes a user&#8217;s password<br />
userperm      Sets the permission levels for a named user.<br />
version      Displays the version number of the LOMlite2 device.</p>
<p>Note:<br />
[Sparc] 任何时候通过Stop+a(SUN键盘)或者ctrl+break(PC键盘)进入到OBP提示符下<br />
ok</p>
]]></content:encoded>
			<wfw:commentRss>http://liuchangjun.com/2009/06/30/sun-netra-t1-lom-usage/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Howto incremental backup linux / windows system by rsync</title>
		<link>http://liuchangjun.com/2008/06/10/howto-incremental-backup-linux-windows-system/</link>
		<comments>http://liuchangjun.com/2008/06/10/howto-incremental-backup-linux-windows-system/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 08:39:22 +0000</pubDate>
		<dc:creator>star</dc:creator>
				<category><![CDATA[Tech Script]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[crontab]]></category>
		<category><![CDATA[cwrsync]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[incremental]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[openssh]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://star.72pines.com/2008/06/10/howto-incremental-backup-linux-windows-system/</guid>
		<description><![CDATA[Howto backup system 目录 1 生成密钥 1.1 在Frontend机器上生成密钥 2 复制密钥 2.1 Fedora linux &#38; Solaris 9 2.2 Redhad linux 3 测试ssh 4 编写同步程序 4.1 在Frontend机器上编写同步程序 4.2 在Windows机器上编写同步程序 4.3 参数意义如下 5 备份目录规则 6 定时执行备份程序 7 FAQ 7.1 如何备份 Solaris 9 上的文件 7.2 如何备份 Windows 上的文件 7.2.1 sshd配置 7.2.2 修复用户 home 配置 7.2.3 避免输入口令 if (window.showTocToggle) { [...]]]></description>
			<content:encoded><![CDATA[<h1 class="firstHeading">Howto backup system</h1>
<p><!-- start content --></p>
<table class="toc" summary="目录">
<tr>
<td>
<p><h2>目录</h2>
<p><span class="toctoggle"><br />
</span></p>
<ul>
<li class="toclevel-1"><a href="http://172.21.128.179/mediawiki/index.php/Howto_backup_system#.E7.94.9F.E6.88.90.E5.AF.86.E9.92.A5"><span class="tocnumber">1</span> <span class="toctext">生成密钥</span></a>
<ul>
<li class="toclevel-2"><a href="http://172.21.128.179/mediawiki/index.php/Howto_backup_system#.E5.9C.A8Frontend.E6.9C.BA.E5.99.A8.E4.B8.8A.E7.94.9F.E6.88.90.E5.AF.86.E9.92.A5"><span class="tocnumber">1.1</span> <span class="toctext">在Frontend机器上生成密钥</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="http://172.21.128.179/mediawiki/index.php/Howto_backup_system#.E5.A4.8D.E5.88.B6.E5.AF.86.E9.92.A5"><span class="tocnumber">2</span> <span class="toctext">复制密钥</span></a>
<ul>
<li class="toclevel-2"><a href="http://172.21.128.179/mediawiki/index.php/Howto_backup_system#Fedora_linux_.26_Solaris_9"><span class="tocnumber">2.1</span> <span class="toctext">Fedora linux &amp; Solaris 9</span></a></li>
<li class="toclevel-2"><a href="http://172.21.128.179/mediawiki/index.php/Howto_backup_system#Redhad_linux"><span class="tocnumber">2.2</span> <span class="toctext">Redhad linux</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="http://172.21.128.179/mediawiki/index.php/Howto_backup_system#.E6.B5.8B.E8.AF.95ssh"><span class="tocnumber">3</span> <span class="toctext">测试ssh</span></a></li>
<li class="toclevel-1"><a href="http://172.21.128.179/mediawiki/index.php/Howto_backup_system#.E7.BC.96.E5.86.99.E5.90.8C.E6.AD.A5.E7.A8.8B.E5.BA.8F"><span class="tocnumber">4</span> <span class="toctext">编写同步程序</span></a>
<ul>
<li class="toclevel-2"><a href="http://172.21.128.179/mediawiki/index.php/Howto_backup_system#.E5.9C.A8Frontend.E6.9C.BA.E5.99.A8.E4.B8.8A.E7.BC.96.E5.86.99.E5.90.8C.E6.AD.A5.E7.A8.8B.E5.BA.8F"><span class="tocnumber">4.1</span> <span class="toctext">在Frontend机器上编写同步程序</span></a></li>
<li class="toclevel-2"><a href="http://172.21.128.179/mediawiki/index.php/Howto_backup_system#.E5.9C.A8Windows.E6.9C.BA.E5.99.A8.E4.B8.8A.E7.BC.96.E5.86.99.E5.90.8C.E6.AD.A5.E7.A8.8B.E5.BA.8F"><span class="tocnumber">4.2</span> <span class="toctext">在Windows机器上编写同步程序</span></a></li>
<li class="toclevel-2"><a href="http://172.21.128.179/mediawiki/index.php/Howto_backup_system#.E5.8F.82.E6.95.B0.E6.84.8F.E4.B9.89.E5.A6.82.E4.B8.8B"><span class="tocnumber">4.3</span> <span class="toctext">参数意义如下</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="http://172.21.128.179/mediawiki/index.php/Howto_backup_system#.E5.A4.87.E4.BB.BD.E7.9B.AE.E5.BD.95.E8.A7.84.E5.88.99"><span class="tocnumber">5</span> <span class="toctext">备份目录规则</span></a></li>
<li class="toclevel-1"><a href="http://172.21.128.179/mediawiki/index.php/Howto_backup_system#.E5.AE.9A.E6.97.B6.E6.89.A7.E8.A1.8C.E5.A4.87.E4.BB.BD.E7.A8.8B.E5.BA.8F"><span class="tocnumber">6</span> <span class="toctext">定时执行备份程序</span></a></li>
<li class="toclevel-1"><a href="http://172.21.128.179/mediawiki/index.php/Howto_backup_system#FAQ"><span class="tocnumber">7</span> <span class="toctext">FAQ</span></a>
<ul>
<li class="toclevel-2"><a href="http://172.21.128.179/mediawiki/index.php/Howto_backup_system#.E5.A6.82.E4.BD.95.E5.A4.87.E4.BB.BD_Solaris_9_.E4.B8.8A.E7.9A.84.E6.96.87.E4.BB.B6"><span class="tocnumber">7.1</span> <span class="toctext">如何备份 Solaris 9 上的文件</span></a></li>
<li class="toclevel-2"><a href="http://172.21.128.179/mediawiki/index.php/Howto_backup_system#.E5.A6.82.E4.BD.95.E5.A4.87.E4.BB.BD_Windows_.E4.B8.8A.E7.9A.84.E6.96.87.E4.BB.B6"><span class="tocnumber">7.2</span> <span class="toctext">如何备份 Windows 上的文件</span></a>
<ul>
<li class="toclevel-3"><a href="http://172.21.128.179/mediawiki/index.php/Howto_backup_system#sshd.E9.85.8D.E7.BD.AE"><span class="tocnumber">7.2.1</span> <span class="toctext">sshd配置</span></a></li>
<li class="toclevel-3"><a href="http://172.21.128.179/mediawiki/index.php/Howto_backup_system#.E4.BF.AE.E5.A4.8D.E7.94.A8.E6.88.B7_home_.E9.85.8D.E7.BD.AE"><span class="tocnumber">7.2.2</span> <span class="toctext">修复用户 home 配置</span></a></li>
<li class="toclevel-3"><a href="http://172.21.128.179/mediawiki/index.php/Howto_backup_system#.E9.81.BF.E5.85.8D.E8.BE.93.E5.85.A5.E5.8F.A3.E4.BB.A4"><span class="tocnumber">7.2.3</span> <span class="toctext">避免输入口令</span></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</td>
</tr>
</table>
<p> if (window.showTocToggle) { var tocShowText = &#8220;显示&#8221;; var tocHideText = &#8220;隐藏&#8221;; showTocToggle(); }</p>
<p class="editsection" style="right; margin-left: 5px">&nbsp;</p>
<p><a name=".E7.94.9F.E6.88.90.E5.AF.86.E9.92.A5"></a></p>
<h2> <strong>生成密钥</strong></h2>
<p class="editsection" style="right; margin-left: 5px">&nbsp;</p>
<p><a name=".E5.9C.A8Frontend.E6.9C.BA.E5.99.A8.E4.B8.8A.E7.94.9F.E6.88.90.E5.AF.86.E9.92.A5"></a></p>
<h3> 在Frontend机器上生成密钥</h3>
<pre># cd ~/.ssh/
# ssh-keygen
# ls -l
total 32
-rw------- 1 root root  1671 Jul 31 11:27 id_rsa
-rw------- 1 root root   395 Jul 31 11:27 id_rsa.pub
-rw-r--r-- 1 root root 10323 Jul 31 16:07 known_hosts</pre>
<p class="editsection" style="right; margin-left: 5px">&nbsp;</p>
<p><a name=".E5.A4.8D.E5.88.B6.E5.AF.86.E9.92.A5"></a></p>
<h2> <strong>复制密钥</strong></h2>
<p>将公共密钥复制到需要同步的服务器上：</p>
<p class="editsection" style="right; margin-left: 5px">&nbsp;</p>
<p><a name="Fedora_linux_.26_Solaris_9"></a></p>
<h3> Fedora linux &amp; Solaris 9</h3>
<pre># scp id_rsa.pub root@ondosrv:/root/.ssh/authorized_keys2</pre>
<p class="editsection" style="right; margin-left: 5px">&nbsp;</p>
<p><a name="Redhad_linux"></a></p>
<h3> Redhad linux</h3>
<pre># scp id_rsa.pub root@ondosrv:/root/.ssh/authorized_keys</pre>
<p class="editsection" style="right; margin-left: 5px">&nbsp;</p>
<p><a name=".E6.B5.8B.E8.AF.95ssh"></a></p>
<h2> <strong>测试ssh</strong></h2>
<p>在Frontend机器上测试</p>
<pre># ssh root@ondosrv</pre>
<p>注释：应该不需要输入密码。</p>
<p class="editsection" style="right; margin-left: 5px">&nbsp;</p>
<p><a name=".E7.BC.96.E5.86.99.E5.90.8C.E6.AD.A5.E7.A8.8B.E5.BA.8F"></a></p>
<h2> <strong>编写同步程序</strong></h2>
<p class="editsection" style="right; margin-left: 5px">&nbsp;</p>
<p><a name=".E5.9C.A8Frontend.E6.9C.BA.E5.99.A8.E4.B8.8A.E7.BC.96.E5.86.99.E5.90.8C.E6.AD.A5.E7.A8.8B.E5.BA.8F"></a></p>
<h3> 在Frontend机器上编写同步程序</h3>
<pre># cd /backup
# vi sync.sh
# chmod 700 sync.sh
----------------------------
Linux:
rsync -avlR --delete -e ssh root@192.168.100.1:/usr/share/tomcat5/ /backup/ondo/
rsync -avlR --delete /home/utstar/ /backup/frontend/
rsync -avlR --delete /var/named/ /backup/frontend/
rsync -avlR --delete /etc/ /backup/frontend/
----------------------------</pre>
<p class="editsection" style="right; margin-left: 5px">&nbsp;</p>
<p><a name=".E5.9C.A8Windows.E6.9C.BA.E5.99.A8.E4.B8.8A.E7.BC.96.E5.86.99.E5.90.8C.E6.AD.A5.E7.A8.8B.E5.BA.8F"></a></p>
<h3> 在Windows机器上编写同步程序</h3>
<pre>rsync -avlR --delete -e ssh '/cygdrive/d/html/PCMS_document/design_document' root@frontend:/backup/hz_3g_filesrv/</pre>
<p class="editsection" style="right; margin-left: 5px">&nbsp;</p>
<p><a name=".E5.8F.82.E6.95.B0.E6.84.8F.E4.B9.89.E5.A6.82.E4.B8.8B"></a></p>
<h3> 参数意义如下</h3>
<pre>-a, --archive
It is a quick way of saying you want recursion and want to preserve almost everything.
-v, --verbose
This option increases the amount of information you are given during the transfer.
-l, --links
When symlinks are encountered, recreate the symlink on the destination.
-R, --relative
Use relative paths. 保留相对路径...才不让子目录跟 parent 挤在同一层...
--delete
是指如果服务器端删除了这一文件，那么客户端也相应把文件删除，保持真正的一致。
-e ssh
建立起加密的连接。</pre>
<p>rsync命令的使用请参照：<a href="http://hi.baidu.com/finet/blog/item/e43dd8f2df3fb412b07ec5ca.html" class="external free" title="http://hi.baidu.com/finet/blog/item/e43dd8f2df3fb412b07ec5ca.html" rel="nofollow">http://hi.baidu.com/finet/blog/item/e43dd8f2df3fb412b07ec5ca.html</a></p>
<p class="editsection" style="right; margin-left: 5px">&nbsp;</p>
<p><a name=".E5.A4.87.E4.BB.BD.E7.9B.AE.E5.BD.95.E8.A7.84.E5.88.99"></a></p>
<h2> <strong>备份目录规则</strong></h2>
<p>备份根目录：</p>
<pre>/backup</pre>
<p>按机器名称建立子目录：</p>
<pre>/backup/ondosrv
/backup/frontend
/backup/mailsrv
......</pre>
<p class="editsection" style="right; margin-left: 5px">&nbsp;</p>
<p><a name=".E5.AE.9A.E6.97.B6.E6.89.A7.E8.A1.8C.E5.A4.87.E4.BB.BD.E7.A8.8B.E5.BA.8F"></a></p>
<h2> <strong>定时执行备份程序</strong></h2>
<pre># crontab -e
0 2 * * * /backup/sync.sh</pre>
<p>注释：每天凌晨2点运行进行同步。</p>
<p class="editsection" style="right; margin-left: 5px">&nbsp;</p>
<p><a name="FAQ"></a></p>
<h2> <strong>FAQ</strong></h2>
<p class="editsection" style="right; margin-left: 5px">&nbsp;</p>
<p><a name=".E5.A6.82.E4.BD.95.E5.A4.87.E4.BB.BD_Solaris_9_.E4.B8.8A.E7.9A.84.E6.96.87.E4.BB.B6"></a></p>
<h3> 如何备份 Solaris 9 上的文件</h3>
<p>Q1: rsync运行出错，e.g. Solaris machine?</p>
<pre>[root@frontend backup]# rsync -avlR --delete -e ssh root@jstart:/jstart/ /backup/vgmsu2/
ksh: rsync:  not found
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(434)</pre>
<p>A: 目的机器上的rsync路径不对，无法找到rsync</p>
<pre>root@vgmsu2:/usr/bin&gt;which rsync
/usr/local/bin/rsync
root@vgmsu2:/usr/bin&gt;ln /usr/local/bin/rsync /usr/bin/rsync
root@vgmsu2:/usr/bin&gt;which rsync
/usr/bin/rsync</pre>
<p class="editsection" style="right; margin-left: 5px">&nbsp;</p>
<p><a name=".E5.A6.82.E4.BD.95.E5.A4.87.E4.BB.BD_Windows_.E4.B8.8A.E7.9A.84.E6.96.87.E4.BB.B6"></a></p>
<h3> 如何备份 Windows 上的文件</h3>
<p>Q2: 使用 ssh 登录 Windows 服务器总是需要输入口令，如何避免口令的输入？</p>
<p class="editsection" style="right; margin-left: 5px">&nbsp;</p>
<p><a name="sshd.E9.85.8D.E7.BD.AE"></a></p>
<h4> sshd配置</h4>
<p>Refer to &#8216;quickstart.txt&#8217;</p>
<pre>$&gt; cd c:\Program Files\OpenSSH\bin
$&gt; mkgroup -l &gt;&gt; ..\etc\group      (local groups)
   mkgroup -d &gt;&gt; ..\etc\group      (domain groups)
$&gt; mkpasswd -l [-u &lt;username&gt;] &gt;&gt; ..\etc\passwd      (local users)
   mkpasswd -d [-u &lt;username&gt;] &gt;&gt; ..\etc\passwd      (domain users)
$&gt; net start opensshd</pre>
<p>现在可以从别的机器用 ssh 登录到 Windows</p>
<p class="editsection" style="right; margin-left: 5px">&nbsp;</p>
<p><a name=".E4.BF.AE.E5.A4.8D.E7.94.A8.E6.88.B7_home_.E9.85.8D.E7.BD.AE"></a></p>
<h4> 修复用户 home 配置</h4>
<p>修改 c:\Program Files\OpenSSH\etc\passwd</p>
<pre>root:unused_by_nt/2000/xp:1012:513:root,U-HZ_3G_FILESRV\root,S-1-5-21-448539723-1450960922-725345543-1012:/cygdrive/c/documents and settings/root:/cygdrive/c/program files/openssh/bin/switch</pre>
<p>使用 /cygdrive/c/documents and settings/root 代替 /home/root/</p>
<p class="editsection" style="right; margin-left: 5px">&nbsp;</p>
<p><a name=".E9.81.BF.E5.85.8D.E8.BE.93.E5.85.A5.E5.8F.A3.E4.BB.A4"></a></p>
<h4> 避免输入口令</h4>
<p>Refer to &#8216;key_authentication.txt&#8217;</p>
<pre>复制客户机上的公共密钥到服务器上
$&gt; mkdir C:\Documents and Settings\root\.ssh
$&gt; copy id_rsa.pub C:\Documents and Settings\root\.ssh\authorized_keys
   copy id_rsa.pub C:\Documents and Settings\root\.ssh\authorized_keys2</pre>
<p>如果还是需要输入口令，则需要修改 sshd 配置文件 sshd.conf / sshd_config</p>
<pre>原来的配置：
StrictModes yes
修改后的配置：
StrictModes no</pre>
<p>重启 sshd 服务，就大功告成了。</p>
<pre>rsync -avlR --delete -e ssh administrator@hz_3g_filesrv:'/cygdrive/d/html/PCMS_document/design_document/' /backup/hz_3g_filesrv/
rsync -avlR --delete -e ssh administrator@hz_3g_filesrv:'/cygdrive/f/share1/PCMS_document/8250/design_document/' /backup/hz_3g_filesrv/
rsync -avlR --delete -e ssh administrator@hz_3g_filesrv:'/cygdrive/f/share1/PCMS_document/8260/design_document/' /backup/hz_3g_filesrv/</pre>
]]></content:encoded>
			<wfw:commentRss>http://liuchangjun.com/2008/06/10/howto-incremental-backup-linux-windows-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
