﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-network</title><link>http://www.cnitblog.com/snfnvtk/</link><description /><language>zh-cn</language><lastBuildDate>Wed, 29 Apr 2026 05:58:24 GMT</lastBuildDate><pubDate>Wed, 29 Apr 2026 05:58:24 GMT</pubDate><ttl>60</ttl><item><title>postfix邮件服务器安全策略</title><link>http://www.cnitblog.com/snfnvtk/archive/2008/07/09/46493.html</link><dc:creator>network</dc:creator><author>network</author><pubDate>Wed, 09 Jul 2008 08:22:00 GMT</pubDate><guid>http://www.cnitblog.com/snfnvtk/archive/2008/07/09/46493.html</guid><wfw:comment>http://www.cnitblog.com/snfnvtk/comments/46493.html</wfw:comment><comments>http://www.cnitblog.com/snfnvtk/archive/2008/07/09/46493.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/snfnvtk/comments/commentRss/46493.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/snfnvtk/services/trackbacks/46493.html</trackback:ping><description><![CDATA[<img height=20 src="http://www.cnitblog.com/Emoticons/QQ/13.gif" width=20 border=0>
<table cellSpacing=0 cellPadding=0 width="100%" border=0>
    <tbody>
        <tr borderColor=#cccccc bgColor=#e3e3e3>
            <td colSpan=2 height=80>
            <div class=14 align=center><strong><font color=#000000>postfix邮件服务器安全策略</font></strong> <br><br></div>
            <div align=center>作者：<a title=曹江华 href="http://www.chinaemail.com.cn/ShowAuthor.asp?ChannelID=1008&amp;AuthorName=曹江华">曹江华</a> 文章来源：<a href="http://www.chinaemail.com.cn/ShowCopyFrom.asp?ChannelID=1008&amp;SourceName=计世网">计世网</a>&nbsp; 更新时间：2006-4-12 9:23:10</div>
            </td>
        </tr>
        <tr borderColor=#cccccc>
            <td colSpan=2 height=174>
            <table width="98%" align=center>
                <tbody>
                    <tr>
                        <td vAlign=center align=middle height=256>
                        <div align=center>
                        <div align=left><span class=black style="FONT-SIZE: 14px; LINE-HEIGHT: 23px"><font face=Verdana>　　邮件系统是Linux网络应用的重要组成，一个完整的邮件系统包括三个部分：底层操作系统（Linux Operation），邮件传送代理（Mail Transport Agent，MTA）,邮件分发代理（Mail Delivery Agent，MDA），邮件用户代理（Mail User Agent，MUA）。</font>
                        <p align=left><font face=Verdana>　　Postfix是一个非常优秀的MTA，她素以高效、安全的特点而著称。Postfix是作者在UNIX上所见过的MTA中在反垃圾邮件（Anti-Spam或Anti-UCE）方面做得最好的一个，甚至有很多公司在Postfix代码的基础上进行二次开发而推出反垃圾邮件网关产品。MTA的反垃圾邮件功能，实际上就是在MTA处理过程中对会话进行过滤。这个过滤不但过滤了发往自身的垃圾邮件，而且还防止了自身被恶意利用发送垃圾邮件。Postfix实现了目前所有主要的MTA过滤技术。postfix是Wietse Venema在</font><font face=Verdana><strong>IBM</strong></font><font face=Verdana>的GPL协议之下开发的MTA（邮件传输代理）软件。和Sendmail相比Postfix更快、更容易管理、更灵活、更安全，同时还与sendmail保持足够的兼容性。Sendmail相比Postfix对比见表1.</font></p>
                        <p align=left><font face=Verdana>　　表1 Sendmail与Postfix的对比 </font></p>
                        <p align=left>　　
                        <table cellPadding=0 width=416 border=1>
                            <tbody>
                                <tr>
                                    <td width=50>
                                    <div align=left twffan="done">MTA</div>
                                    </td>
                                    <td width=50>
                                    <div align=left twffan="done">成熟性</div>
                                    </td>
                                    <td width=50>
                                    <div align=left twffan="done">安全性</div>
                                    </td>
                                    <td width=50>
                                    <div align=left twffan="done">特色</div>
                                    </td>
                                    <td width=50>
                                    <div align=left twffan="done">性能</div>
                                    </td>
                                    <td width=100>
                                    <div align=left twffan="done">Sendmail兼容性</div>
                                    </td>
                                    <td width=80>
                                    <div align=left twffan="done">模块化设计</div>
                                    </td>
                                </tr>
                                <tr>
                                    <td width=50>
                                    <div align=left twffan="done">Postfix</div>
                                    </td>
                                    <td width=50>
                                    <div align=left twffan="done">中</div>
                                    </td>
                                    <td width=50>
                                    <div align=left twffan="done">中</div>
                                    </td>
                                    <td width=50>
                                    <div align=left twffan="done">中</div>
                                    </td>
                                    <td width=50>
                                    <div align=left twffan="done">中</div>
                                    </td>
                                    <td width=100>
                                    <div align=left twffan="done">支持</div>
                                    </td>
                                    <td width=80>
                                    <div align=left twffan="done">是</div>
                                    </td>
                                </tr>
                                <tr>
                                    <td width=50>
                                    <div align=left twffan="done">Sendmail</div>
                                    </td>
                                    <td width=50>
                                    <div align=left twffan="done">高</div>
                                    </td>
                                    <td width=50>
                                    <div align=left twffan="done">低</div>
                                    </td>
                                    <td width=50>
                                    <div align=left twffan="done">中</div>
                                    </td>
                                    <td width=50>
                                    <div align=left twffan="done">低</div>
                                    </td>
                                    <td width=100>
                                    <div align=left twffan="done"></div>
                                    </td>
                                    <td width=80>
                                    <div align=left twffan="done">否</div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        </p>
                        <p align=left><font face=Verdana>　　垃圾邮件(SPAM) 也称作UCE (Unsolicited Commercial Email，未经许可的商业电子邮件) 或UBE (Unsolicited Bulk Email,未经许可的大量电子邮件) 。中国互联网协会对垃圾邮件给出了一个正式的定义，只要是符合下述四条之一的电子邮件都可被称为垃圾邮件： </font></p>
                        <p align=left><font face=Verdana>　　（1）收件人事先没有提出要求或同意接收的广告、电子刊物、各种形式的宣传品等宣传性的电子邮件。 </font></p>
                        <p align=left><font face=Verdana>　　（2）收件人无法拒收的电子邮件。 </font></p>
                        <p align=left><font face=Verdana>　　（3）隐藏发件人身份、地址、标题等信息的电子邮件；。</font></p>
                        <p align=left><font face=Verdana>　　（4）含有虚假的信息源、发件人、路由等信息的电子邮件。 <br>　　垃圾电子邮件成为了人们最头疼的<a class=channel_keylink href="http://bbs.chinaemail.com.cn/" target=_blank><font color=#000000>问题</font></a>之一。在Windows操作系统中也许您已经尝够了垃圾邮件给您带来的苦头，不要以为在Linux操作系统平台中就能避免垃圾电子邮件给我们带来的骚扰，反击和过滤垃圾电子 邮件是一件很重要的工作。下面是一些在Linux中广泛使用的防垃圾邮件技术。 </font></p>
                        <p align=left></p>
                        <p align=left><font face=Verdana>　　（1）SMTP用户认证 </font></p>
                        <p align=left><font face=Verdana>　　目前常见并十分有效的方法是，在邮件传送代理（Mail Transport Agent，MTA）上对来自本地网络以外的互联网的发信用户进行SMTP认证，仅允许通过认证的用户进行远程转发。这样既能够有效避免邮件传送代理服务器为垃圾邮件发送者所利用，又为出差在外或在家工作的员工提供了便利。如果不采取SMTP认证，则在不牺牲安全的前提下，设立面向互联网的Web邮件网关也是可行的。此外，如果SMTP服务和POP3服务集成在同一服务器上，在用户试图发信之前对其进行POP3访问验证（POP before SMTP）就是一种更加安全的方法，但在应用的时候要考虑到当前支持这种认证方式的邮件客户端程序还不多。 </font></p>
                        <p align=left><font face=Verdana>　　（2）逆向名字解析 </font></p>
                        <p align=left><font face=Verdana>　　无论哪一种认证，其目的都是避免邮件传送代理服务器被垃圾邮件发送者所利用，但对于发送到本地的垃圾邮件仍然无可奈何。要解决这个<a class=channel_keylink href="http://bbs.chinaemail.com.cn/" target=_blank><font color=#000000>问题</font></a>，最简单有效的方法是对发送者的IP地址进行逆向名字解析。通过DNS查询来判断发送者的IP与其声称的名字是否一致，例如，其声称的名字为mx.hotmail.com，而其连接地址为20.200.200.200，与其DNS记录不符，则予以拒收。这种方法可以有效过滤掉来自动态IP的垃圾邮件，对于某些使用动态域名的发送者，也可以根据实际情况进行屏蔽。但是上面这种方法对于借助Open Relay的垃圾邮件依然无效。对此，更进一步的技术是假设合法的用户只使用本域具有合法互联网名称的邮件传送代理服务器发送电子邮件。例如，若发件人的邮件地址为someone@yahoo.com，则其使用的邮件传送代理服务器的Internet名字应具有yahoo.com 的后缀。这种限制并不符合SMTP协议，但在多数情况下是切实有效的。需要指出的是，逆向名字解析需要进行大量的DNS查询。</font></p>
                        <p align=left><font face=Verdana>　　（3）实时黑名单过滤 </font></p>
                        <p align=left><font face=Verdana>　　以上介绍的防范措施对使用自身合法域名的垃圾邮件仍然无效。对此比较有效的方法就是使用黑名单服务了。黑名单服务是基于用户投诉和采样积累而建立的、由域名或IP组成的数据库，最著名的是RBL、DCC和Razor等，这些数据库保存了频繁发送垃圾邮件的主机名字或IP地址，供MTA进行实时查询以决定是否拒收相应的邮件。但是，目前各种黑名单数据库难以保证其正确性和及时性。例如，北美的RBL和DCC包含了我国大量的主机名字和IP地址，其中有些是早期的Open Relay造成的，有些则是由于误报造成的。但这些迟迟得不到纠正，在一定程度上阻碍了我国与北美地区的邮件联系，也妨碍了我国的用户使用这些黑名单服务。其中使用BRL认证过程见图1.</font></p>
                        <p align=left><font face=Verdana><img src="http://www.chinaemail.com.cn/server/UploadFiles_2618/200604/20060412112839101.jpg" border=0 twffan="done"></font></p>
                        <p align=left><font face=Verdana>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 图1 使用BRL过滤垃圾邮件的过程 </font></p>
                        <p align=left><font face=Verdana>　　（4）内容过滤 </font></p>
                        <p align=left><font face=Verdana>　　即使使用了前面诸多环节中的技术，仍然会有相当一部分垃圾邮件漏网。对此情况，目前最有效的方法是基于邮件标题或正文的内容过滤。其中比较简单的方法是，结合内容扫描引擎，根据垃圾邮件的常用标题语、垃圾邮件受益者的姓名、电话号码、Web地址等信息进行过滤。更加复杂但同时更具智能性的方法是，基于贝叶斯概率理论的统计方法所进行的内容过滤，该算法最早由Paul Graham提出（http://www.paulgraham.com/spam.html），并使用他自己设计的Arc语言实现。这种方法的理论基础是通过对大量垃圾邮件中常见关键词进行分析后得出其分布的统计模型，并由此推算目标邮件是垃圾邮件的可能性。这种方法具有一定的自适应、自学习能力，目前已经得到了广泛的应用。最有名的垃圾邮件内容过滤是Spamassassin，它使用Perl语言实现，集成了以上两种过滤方法，可以与当前各种主流的MTA集成使用。内容过滤是以上所有各种方法中耗费计算资源最多的，在邮件流量较大的场合，需要配合高性能服务器使用。 下面以RHEL 4.0为例，介绍上面几种技术应对安全隐患。<br>安装postfix </font></p>
                        <p align=left></p>
                        <p align=left><font face=Verdana>　　1、查询Sendmail是否安装：</font></p>
                        <p align=left><font face=Verdana>　　＃rpm -qa |grep sendmail</font></p>
                        <p align=left><font face=Verdana>　　2、强行卸载Sendmail</font></p>
                        <p align=left><font face=Verdana>　　# rpm -e sen </p>
                        <p align=left>　　dmail sendmail-cf sendmail-doc &#8211;nodeps</font></p>
                        <p align=left><font face=Verdana>　　3、用以下命令杀死运行中的sendmail进程：</font></p>
                        <p align=left><font face=Verdana>　　#&nbsp; kill all sendmail</font></p>
                        <p align=left><font face=Verdana>　　4、下载安装Posfix</font></p>
                        <p align=left><font face=Verdana>　　#wget ftp://ftp.midvalleyhosting.com/pub/postfix/official/postfix-2.1.4.t ar.gz /tmp</font></p>
                        <p align=left><font face=Verdana>　　＃tar -vxf postfix-2.1.4.tar.gz</font></p>
                        <p align=left><font face=Verdana>　　#cd postfix-2.1.4</font></p>
                        <p align=left><font face=Verdana>　　5．编译源代码包</font></p>
                        <p align=left><font face=Verdana>　　# make</font></p>
                        <p align=left><font face=Verdana>　　6．建立一个新用户&#8220;postfix&#8221;，该用户必须具有唯一的用户ID号和组ID号，同时应该让该用户不能登录到系统，也即不为该用户指定可执行的登录外壳程序和可用的用户宿主目录。我们可以先用adduser postfix 添加用户再编辑/etc/passwd文件中的相关条目如下所示：</font></p>
                        <p align=left><font face=Verdana>　　# useradd postfix</font></p>
                        <p align=left><font face=Verdana>　　＃ postfix:*:12345:12345:postfix:/no/where:/no/shell</font></p>
                        <p align=left><font face=Verdana>　　#groupadd postdrop</font></p>
                        <p align=left><font face=Verdana>　　7．确定/etc/aliases文件中包含如下的条目：</font></p>
                        <p align=left><font face=Verdana>　　# postfix: root</font></p>
                        <p align=left><font face=Verdana>　　8． 以root用户登录，在/tmp/ postfix目录下执行命令：</font></p>
                        <p align=left><font face=Verdana>　　# ./INSTALL.sh</font></p>
                        <p align=left><font face=Verdana>　　9.启动postfix</font></p>
                        <p align=left><font face=Verdana>　　#&nbsp; postfix start</font></p>
                        <p align=left><font face=Verdana>　　postfix的配置文件位于/etc/postfix下，这四个文件就是postfix最基本的配置文件，它们的区别在于：mail.cf：是postfix主要的配置文件。Install.cf：包含安装过程中安装程序产生的postfix初始化设置。　　　　　master.cf：是postfix的master进程的配置文件，该文件中的每一行都是用来配置postfix的组件进程的运行方式。postfix-script：包装了一些postfix命令，以便我们在linux环境中安全地执行这些postfix命令。</font></p>
                        <p align=left><font face=Verdana>　　10、使用postfix本身规则拒收垃圾邮件：</font></p>
                        <p align=left><font face=Verdana>　　1、&nbsp; 使用头信息过滤邮件：</font></p>
                        <p align=left><font face=Verdana>　　通常我们可以使用例如To、From、Subject等这样标准的邮件头来拒收垃圾邮件。在mail.cf中加入一行：header_checks = regexp:/etc/postfix/header_checks，它告诉postfix读取名为/etc/postfix/reject-headers的文件， 因为缺省地，postfix不进行信头过滤。</font></p>
                        <p align=left><font face=Verdana>　　格式是：regexp REJECT ；其中regexp是常规表达式，下面是一个标准的/etc/postfix/reject-headers文件其中一般以下包括内容：</font></p>
                        <p align=left><font face=Verdana>　　/^To You @xoom\.com $/ REJECT</font></p>
                        <p align=left><font face=Verdana>　　/^From mailer-daemon @myclient.com $ / REJECT</font></p>
                        <p align=left><font face=Verdana>　　/^Subject: Make menoey fast / REJECT<br>　　以上三行分别说明： </font></p>
                        <p align=left></p>
                        <p align=left><font face=Verdana>　　1、拒收邮件头中包括字符串：You @xoom\.com 的邮件。</font></p>
                        <p align=left><font face=Verdana>　　2、拒收来自mailer-daemon @myclient.com的邮件。</font></p>
                        <p align=left><font face=Verdana>　　3、拒收邮件主题：包括Make menoey fast内容的邮件。</font></p>
                        <p align=left>　　2、 通过阻止IP地址或主机名方式访问邮件服务器来拒收邮件：</p>
                        <p align=left>　　（1）&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在main.cf配置文件中使用以下行定义网络地址&#8220;</p>
                        <p align=left>　　# mynetwork=192.168.1.0/24</p>
                        <p align=left>　　表示除非客户端的ip地址符合$mynetworks参数定义的范围则接受该客户端的连接请求，才转发该邮件。</p>
                        <p align=left>　　（2）&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 添加一行拒绝本地网络以外的主机访问本地邮件服务器：</p>
                        <p align=left>　　smtpd_client_restrictions = permit_mynetworks, reject_unknown_client</p>
                        <p align=left>　　（3）在postfix中添加RBL功能</p>
                        <p align=left>　　RBL（Realtime Blackhole List）是实时黑名单。国外有一些机构提供RBL服务，它们把收集到的专发垃圾邮件的IP地址加入他们的黑名单，我们只要在postfix中加入RBL认证功能，就会使我们的邮件服务器在每次收信时都自动到RBL服务器上去查实，如果信件来源于黑名单，则postfix会拒收邮件，从而少受垃圾邮件之苦。通常在mail.cf加入</p>
                        <p align=left>　　map_rb1_domains=mail-abuse.org</p>
                        <p align=left>　　smtp_client_restrictions=reject_map1_rb1</p>
                        <p align=left>　　其中第一行设置需要联系得到的RBL列表的所有主机，接着设置需要进行应用的限制。然后存盘，从新启动postfix服务器。</p>
                        <p align=left>　　国外比较有名的RBL是http//www.ordb.org，他们的RBL可免费使用，去年国内的http://anti-spam.org.cn也提供类似的服务，但它必须先注册才能使用免费。</p>
                        <p align=left>　　另外垃圾邮件的防范必须掌握好尺度，postfix本身提供了header_check、body_check、access、classes等方式来拒绝邮件，可以参考如下地址的样例，结合自己的情况进行修改也能阻止一部分垃圾邮件： <br>　　<a href="http://www.securitysage.com/guides/postfix_uce_header.html"><font color=#000000>http://www.securitysage.com/guides/postfix_uce_header.html</font></a> <br>　　<a href="http://www.securitysage.com/guides/postfix_uce_body.html"><font color=#000000>http://www.securitysage.com/guides/postfix_uce_body.html</font></a> <br>　　<a href="http://www.securitysage.com/guides/postfix_uce_access.html"><font color=#000000>http://www.securitysage.com/guides/postfix_uce_access.html</font></a> <br>　　<a href="http://www.securitysage.com/guides/postfix_uce_class.html"><font color=#000000>http://www.securitysage.com/guides/postfix_uce_class.html</font></a>&nbsp;<br>&nbsp;　　不过以上配置文件需要管理员根据自己情况手工进行修改，如果直接采用的话，那么国内很多邮件你将收不到。</p>
                        <p align=left>　　二、安装IMSS </p>
                        <p align=left><font face=Verdana><strong>　　趋势科技</strong></font>的IMSS（InterS<font face=Verdana><strong>ca</strong></font>n Messaging Security Suite）版整合了垃圾邮件防治服务SPS（Spam Prevention Solution）2.0版。一般来说，过滤服务器上的垃圾邮件主要采取如下两种方法：一是根据设置的规则直接拒收垃圾邮件；二是将邮件接收下来后再实施过滤。相比来看，前一种方法具有更高的效率，对邮件直接拒收，既节省网络带宽，又可减小服务器的性能开销。但是，这样做常常容易&#8220;殃及无辜&#8221;，使邮件用户丢失信件。后一种方法尽管效率不高，却可能减少出错的频率。如果服务器首先对接收下来的邮件进行有效分析，然后再交由用户进行选择，那么用户就不会为E-mail的无故丢失而烦恼。IMSS属于后者。<br>IMSS主要功能： </p>
                        <p align=left></p>
                        <p align=left><font face=Verdana>　　1. 利用数据库对比实现垃圾邮件过滤 ：提供被动式的垃圾邮件拦阻方式，利用建立垃圾邮件的黑名单数据库，根据来源的IP地址、网域，寄件人的电子邮件地址或是内容、标头所含的关</font><font face=Verdana>键词等做为数据库的基础。再将寄达的电子邮件与这已知的垃圾邮件数据库比对，藉以判别是否为垃圾邮件然后再来做拦阻的动作</font></p>
                        <p align=left>　　2. 智能型判断过滤垃圾邮件 ：提供启发式（Heuristic）扫描引擎，实现主动式的智能拦阻方式，根据邮件的多项特征，包括内容、标头、格式等来判断这封email会不会是封垃圾邮件，再来针对这封电子邮件做处理。可以用来辨识和监测已识别及未识别的新型垃圾邮件。</p>
                        <p align=left>　　3. 支持弹性设定垃圾邮件过滤器规则 ：为了规避误判风险，当SPS检测出垃圾邮件之后，还会依照确信程度的不同分作四种等级，再依据设定进行&#8220;只做标记&#8221;、&#8220;隔离邮件&#8221;及&#8220;直接删除&#8221;操作。</p>
                        <p align=left>　　4. 支持黑名单及白名单功能 ：支持黑名单（恶意邮件地址）及白名单（可信邮件地址）功能 。可以针对邮件来源网域，寄件者甚至是电子邮件本身的关键词来做特别处理的动作。这项功能可以实现针对某些网域或是寄件者的信件设定规则，不仅要严加看管，必要情况下可以直接列入拒绝往来列表。</p>
                        <p align=left>　　5. 实现与IMSS邮件病毒过滤网关集成： 通过产品的深度集成，可以实现多种判别条件的组合，能够更准确、更高效地进行网关级的邮件过滤，更完善地保护企业内部网络资源。</p>
                        <p align=left>　　6. 多平台支持（Windows 2000/2003、Linux、Unix）。</p>
                        <p align=left>　　硬件配置：CPU：<font face=Verdana><strong>Intel</strong></font> Pentium III processor 1 GHz 以上处理器,Memory：1 GB RAM,Disk Space：最小 2 GB 硬盘空间.交换空间2GB。</p>
                        <p align=left>　　1．&nbsp; 修改/etc/postfix/main.cf中如下参数，更改为：</p>
                        <p align=left>　　myhostname = trendmicro.com.cn</p>
                        <p align=left>　　mydomain = trendmicro.com.cn</p>
                        <p align=left>　　myorigin = trendmicro.com.cn</p>
                        <p align=left>　　inet_interfaces＝all</p>
                        <p align=left>　　mydestination = trendmicro.com.cn</p>
                        <p align=left>　　local_recipient_maps =</p>
                        <p align=left>　　/黑色域名部分请填写对应的domain name.</p>
                        <p align=left>&nbsp;　　2．&nbsp; 在 /var/spool/postfix目录下新建etc目录，并运行：</p>
                        <p align=left>　　# cp /etc/resolv.conf /var/spool/postfix/etc/</p>
                        <p align=left>　　3、下载安装IMSS 5.5</p>
                        <p align=left>　　下载之前需要到软件官方网站，注册并且得到一个AC—CODE，您需要提供以上激活码以得到病毒码及其他安全补丁的下载.下载链接：<a href="http://www.trendmicro.com/ftp/products/interscan/imss55linux1064.tar.gz"><font color=#000000>http://www.trendmicro.com/ftp/products/interscan/imss55linux1064.tar.gz</font></a> </p>
                        <p align=left>　　将下载文件拷贝到一个临时目录/tmp中。</p>
                        <p align=left>　　# tar vxf imss55linux1064.tar.gz</p>
                        <p align=left>　　#make;make install</p>
                        <p align=left>　　#./isinst </p>
                        <p align=left>　　系统提供了一个交换式的命令行界面，安装中请选择支持postfix，并根据实际情况确定是否安装集中管理平台（TMCM）。安装结束系统提示可以打开Web管理的IP地址和端口号：见图2。</p>
                        <p align=left><img src="http://www.chinaemail.com.cn/server/UploadFiles_2618/200604/20060412112840306.jpg" border=0 twffan="done"><br>　　图2 IMSS 5.5 安装完成<br>　　4、命令行下的参数配置： </font></p>
                        <p align=left></p>
                        <p align=left><font face=Verdana>　　1、/etc/postfix/main.cf文件末尾添加如下内容：</font></p>
                        <p align=left><font face=Verdana>　　default_process_limit=200</font></p>
                        <p align=left><font face=Verdana>　　imss_timeout=10m</font></p>
                        <p align=left><font face=Verdana>　　imss_connect_timeout=1s</font></p>
                        <p align=left><font face=Verdana>　　content_filter = imss:localhost:10025</font></p>
                        <p align=left><font face=Verdana>　　imss_destination_recipient_limit=200</font></p>
                        <p align=left><font face=Verdana>　　imss_destination_concurrency_limit=20</font></p>
                        <p align=left><font face=Verdana>&nbsp;　　2、在/etc/postfix/master.cf文件末尾添加以下内容：</font></p>
                        <p align=left><font face=Verdana>　　#IMSS: content filter smtp transport "imss" for IMSS</font></p>
                        <p align=left><font face=Verdana>　　imss&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unix&nbsp; -&nbsp;&nbsp; -&nbsp;&nbsp; n&nbsp;&nbsp; -&nbsp;&nbsp; -&nbsp;&nbsp; smtp</font></p>
                        <p align=left><font face=Verdana>　　-o disable_dns_lookups=yes</font></p>
                        <p align=left><font face=Verdana>　　-o smtp_connect_timeout=$imss_connect_timeout</font></p>
                        <p align=left><font face=Verdana>　　-o smtp_data_done_timeout=$imss_timeout</font></p>
                        <p align=left><font face=Verdana>　　#IMSS: content filter loop back smtpd</font></p>
                        <p align=left><font face=Verdana>l　　ocalhost:10026&nbsp;&nbsp;&nbsp;&nbsp; inet&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; smtpd</font></p>
                        <p align=left><font face=Verdana>　　-o content_filter=</font></p>
                        <p align=left><font face=Verdana>　　-o smtpd_timeout=$imss_timeout</font></p>
                        <p align=left><font face=Verdana>　　-o local_recipient_maps=</font></p>
                        <p align=left><font face=Verdana>　　-o myhostname=localhost.$mydomain</font></p>
                        <p align=left><font face=Verdana>　　3．&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Relay 控制</font></p>
                        <p align=left><font face=Verdana>　　a．&nbsp; 允许Relay的Domain设置：</font></p>
                        <p align=left><font face=Verdana>　　编辑/etc/postfix/main.cf文件，在如下位置添加允许的任意Relay的Domain，如：</font></p>
                        <p align=left><font face=Verdana>　　relay_domains =&nbsp; 263.net</font></p>
                        <p align=left><font face=Verdana>　　b．&nbsp; 允许接受的Domain设置：</font></p>
                        <p align=left><font face=Verdana>　　编辑/etc/postfix/main.cf文件，在如下位置添加允许接受的Domain</font></p>
                        <p align=left><font face=Verdana>　　mydestination = trendmicro.com.cn</font></p>
                        <p align=left><font face=Verdana>　　c．&nbsp; 不受Relay限制的地址设置</font></p>
                        <p align=left><font face=Verdana>&nbsp;&nbsp;&nbsp; 编辑/etc/postfix/main.cf文件，在如下位置添加允许接受的Domain</font></p>
                        <p align=left><font face=Verdana>&nbsp;&nbsp;&nbsp; mynetworks = 10.11.240.0/24, 127.0.0.1</font></p>
                        <p align=left><font face=Verdana>　　说明：所谓Relay就是指别人能用这台SMTP邮件服务器，给任何人发信，这样别有用心的垃圾发送者可以使用笔者单位的这台邮件服务器大量发送垃圾邮件，而最后别人投诉的不是垃圾发送者，而是单位的服务器。</font></p>
                        <p align=left><font face=Verdana>　　参数relay_domains &amp; mydestination的主要区别在于：</font></p>
                        <p align=left><font face=Verdana>　　Postfix会转发目的地符合 $relay_domains及其子域的邮件；</font></p>
                        <p align=left><font face=Verdana>　　Postfix会接受目的地符合 $mydestination的邮件，并且在没有smart host的情况下尝试对这些域进行本地落地处理，因而，为了能正常的接受这些邮件，一定要对齐设置smart host；IMSS UNIX的Relay 控制界面设置中的域，即是$mydestination参数值，因而，一定要在IMSS的Domain-Based Delivery中做相应Deliver设置。<br></p>
                        <p align=left><font face=Verdana>　　5、重新启动Postfix服务器：</font></p>
                        <p align=left><font face=Verdana>　　#postfix start</font></p>
                        <p align=left><font face=Verdana>　　重新让postfix读取更改后的配置只需运行&#8220;postfix reload&#8221;即可。</font></p>
                        <p align=left><font face=Verdana>　　打开服务器的8081端口：</font></p>
                        <p align=left><font face=Verdana>　　# iptables -A FORWARD -i eth0 -p tcp --dport 8081 -j ACCEPT</font></p>
                        <p align=left><font face=Verdana>　　iptables -A FORWARD -i eth0 -p udp --dport 8081 -j ACCEPT</font></p>
                        <p align=left><font face=Verdana></font></p>
                        <p align=left><font face=Verdana>　　&nbsp;6、启用Web方式管理：</font></p>
                        <p align=left><font face=Verdana>　　服务器从新启动完毕，可以进行Web方式管理，开Web浏览器中输入：<a href="http://yourip:8081/IMSS.html"><font color=#000000>http://yourip:8081/IMSS.html</font></a>或者http://yourhost:8445/IMSS.html 即可。第一次进入Web界面时系统提示输入密码，此时密码是空的，可以直接用鼠标点击&#8220;Enter&#8221;键进入Web管理界面后，马上设定管理员密码。见图3。</font></p>
                        <p align=left><font face=Verdana></font>&nbsp;</p>
                        <p align=left><font face=Verdana><img src="http://www.chinaemail.com.cn/server/UploadFiles_2618/200604/20060412112841173.jpg" border=0 twffan="done"></font></p>
                        <p align=left><font face=Verdana>图－3 首次登陆界面</font></p>
                        <p align=left><font face=Verdana>　　点击&#8220;Policy Manager&#8221;选项，下面就可以制定自己的邮件服务器邮件管理策略，见图4。</font></p>
                        <p align=left><font face=Verdana><img src="http://www.chinaemail.com.cn/server/UploadFiles_2618/200604/20060412112841398.jpg" border=0 twffan="done"></font></p>
                        <p align=left><font face=Verdana>图－4 基于Web方式的IMSS 5.5的邮件管理策略界面<br>　　5 、软件升级 </font></p>
                        <p align=left></p>
                        <p align=left><font face=Verdana>　　可以采取两种方法Web方式和命令行，这里笔者喜欢在命令行下操作：</font></p>
                        <p align=left><font face=Verdana>　　下载升级布丁，链接：<a href="http://www.trendmicro.com/ftp/products/"><font color=#000000>http://www.trendmicro.com/ftp/products/</font></a> patches/isem522-imss55-linux-patch1.tar.gz </font></p>
                        <p align=left><font face=Verdana>　　＃mv isem522-imss55-linux-patch1.tar.gz /tmp</font></p>
                        <p align=left><font face=Verdana>　　#cd /tmp</font></p>
                        <p align=left><font face=Verdana>　　#gunzip isem522-imss55-linux-patch1.tar.gz</font></p>
                        <p align=left><font face=Verdana>　　#./patchinstall install</font></p>
                        <p align=left><font face=Verdana>　　软件升级过程中IMSS5.5服务将暂时中止，升级后系统会自动启动IMSS 5.5服务。见图－5。</font></p>
                        <p align=left><font face=Verdana><img src="http://www.chinaemail.com.cn/server/UploadFiles_2618/200604/20060412112841855.jpg" border=0 twffan="done"></font></p>
                        <p align=left><font face=Verdana>图5 升级IMSS数据库</font></p>
                        <p align=left><font face=Verdana>　　三、使用专用工具防止垃圾邮件</font></p>
                        <p align=left><font face=Verdana>　　还可以利用其他的专用工具来防止垃圾邮件，比较著名的有由Matt Sergeant、Craig Hughes和Justin Mason于发布的SpamAssassin（SA）。目前最新版本是3.0.2，它是较为流行的反垃圾邮件软件，据SpamAssassin供应商 Deersoft的统计，目前大约有3万台Unix服务器上使用了SpamAssassin。SpamAssassin利用Perl语言来对邮件内容进行规则匹配，从而达到判断过滤垃圾邮件的目的。它的判断方式是基于评分的方式，也就是说如果这封邮件符合某条规则，则给与一定分值；当累计的分值超过了一定限度时，则判定该邮件为垃圾邮件。对Sendmail、Qmail、Postfix和Exim等各种邮件平台都适用。当它被最终用户或系统管理员调用时，它可以方便地与大多数流行的邮件处理系统进行接口互连。SpamAssassin在对一封信件应用了各项规则之后，生成一个分值来表示其为垃圾邮件的可能性。它可以设置上百条规则，包括对邮件头的处理、对邮件内容的处理及对邮件结构的处理等。每条规则都对应一个分值（可正、可负），每封信件的分值就是所匹配规则的分值之和。如果分值为负，表示这封信件是正常的；相反，如果分值为正，则表示信件有<a class=channel_keylink href="http://bbs.chinaemail.com.cn/" target=_blank><font color=#000000>问题</font></a>。如果超过了某个默认的分值，过滤器就会标识其可能为垃圾邮件，然后交由用户做出最终抉择。SpamAssassin的安装过程比较简单。启动SpamAssassin服务器：</font></p>
                        <p align=left><font face=Verdana>　　# service spamassassin start （启动SpamAssassin服务器）</font></p>
                        <p align=left><font face=Verdana>　　Starting spamd:[&nbsp; 确定&nbsp; ]</font></p>
                        <p align=left><font face=Verdana>　　配置过程：</font></p>
                        <p align=left><font face=Verdana>　　SpamAssassin预设了许多默认规则，可以在/usr/share/spamassassin下找到，用户想添加自己的规则，可以配置通过/etc/mail/spamassassin/local.cf文件实现。要在其中添加白名单（即可以确信不会发送垃圾邮件的发件人列表）。设置代码如下：</font></p>
                        <p align=left><font face=Verdana>　　whitelist_from_rcvd&nbsp; people@basic.com</font></p>
                        <p align=left><font face=Verdana>　　whitelist_from_rcvd&nbsp; @ people.com</font></p>
                        <p align=left><font face=Verdana>　　以上两条规则将people@basic.com 邮箱和@ people.com 整个域加入了白名单。下面还要把SpamAssassin与Sendmail（此处以Postfix为例、Qmail略有不同）整合在一起。最简单的方法是使用procmail来调用SpamAssassin过滤器。procmail来调用SpamAssassin的过程见图6。</font></p>
                        <p align=left><font face=Verdana><img src="http://www.chinaemail.com.cn/server/UploadFiles_2618/200604/20060412112841647.jpg" border=0 twffan="done"></font></p>
                        <p align=left><font face=Verdana>　　图6 procmail来调用SpamAssassin的过程<br>　　添加以下内容到/etc/procmailrc文件： </font></p>
                        <p align=left></p>
                        <p align=left><font face=Verdana>:0fw </font></p>
                        <p align=left><font face=Verdana>| /usr/bin/spamassassin</font></p>
                        <p align=left><font face=Verdana>：0</font></p>
                        <p align=left><font face=Verdana>* X-Spam-Status: Yes </p>
                        <p align=left></font><font face=Verdana>spam</font></p>
                        <p align=left><font face=Verdana>　　如果希望SpamAssassin不检查大邮件，可以对其做出限制，添加一行： </font></p>
                        <p align=left><font face=Verdana>:0fw * &lt; 1000000 | /usr/bin/spamassassin</font></p>
                        <p align=left><font face=Verdana>　　这段代码表示把邮件检查的大小限制在1000K字节以内。SpamAssassin还提供了一个专门的spamd后台守护程序，可以设置为系统启动时自动启动它。在Mail-SpamAssassin-3.-0.2/spamd/下有一个redhat-rc-script.sh脚本，将此脚本放入Red Hat的启动目录/etc/rc.d/init.d/下即可。同时，还需要对/etc/procmailrc文件做如下修改： </font></p>
                        <p align=left><font face=Verdana>:0fw</font></p>
                        <p align=left><font face=Verdana>| /usr/bin/spamc -s 100000</font></p>
                        <p align=left><font face=Verdana>　　这样就可以通过控制spamd进程来调整过滤器的运行状态。配置完成后，可以发邮件进行测试。如果看到在邮件头出现与spam检查相关的几项内容，表示SpamAssassin已经开始发挥作用。</font></p>
                        <p align=left><font face=Verdana>　　除了设置内部的规则之外，SpamAssassin也可以访问其它外部的垃圾邮件过滤规则集，这样可以进一步增强其适用性。Chinese_rules.cf是用于垃圾邮件过滤系统SpamAssassin的中文垃圾邮件过滤规则集。由于以前没有中文的过滤规则集，SpamAssassin对中文邮件过滤的准确性不高。CCERT反垃圾邮件研究小组推出了第一个基于SpamAssassin的中文垃圾邮件过滤规则集Chinese_rules.cf。该规则集每周更新一次。把Chinese_rules.cf复制到/usr/share/spamassassin配置文档中的命令：</font></p>
                        <p align=left><font face=Verdana># wget -N -P /usr/share/spamassassin www.ccert.edu.cn/spam/sa/Chinese_rules.cf</font></p>
                        <p align=left><font face=Verdana>　　自动更新：</font></p>
                        <p align=left><font face=Verdana>　　CCERT每周更新一次规则集，更新使用CCERT反垃圾邮件服务在6个月内处理过的垃圾邮件为样本。经常更新Chinese_rules.cf会使过滤效果更好。</font></p>
                        <p align=left><font face=Verdana>　　Linux有一个称为crond的守护程序，主要功能是周期性地检查 /var/spool/cron目录下的一组命令文件的内容，并在设定的时间执行这些文件中的命令。用户可以通过crontab 命令来建立、修改、删除这些命令文件。例如用 crontab命令实现每周一08:35自动更新：</font></p>
                        <p align=left><font face=Verdana>　　首先建立一个文件，文件名称myproject(名称自己设定)：</font></p>
                        <p align=left><font face=Verdana>＃crontab －e</font></p>
                        <p align=left><font face=Verdana>　　文件内容：</font></p>
                        <p align=left><font face=Verdana>　　35 08 * * 1 wget -N -P /usr/share/spamassassin 　　<a href="http://www.ccert.edu.cn/spam/sa/Chinese_rules.cf"><font color=#000000>www.ccert.edu.cn/spam/sa/Chinese_rules.cf</font></a>; /etc/init.d/init-script restart </font><font face=Verdana>用vi编辑后存盘退出。</font></p>
                        <p align=left><font face=Verdana>　　（3）使用 crontab命令添加到任务列表中：</font></p>
                        <p align=left><font face=Verdana>　　＃crontab myproject</font></p>
                        <p align=left><font face=Verdana>　　这样Linux服务器会在每星期一的8点35分会自动下载Chinese_rules.cf更新规则。</font></p>
                        <p align=left><font face=Verdana>　　SpamAssassin使用基于规则的垃圾邮件过滤技术，比分布式黑名单运行得更快，因为分布式黑名单需要查询网络服务器。对大多数用户而言，它能捕捉几乎所有的垃圾邮件，而不需要隔离合法邮件。实际上它还提供了无限的调整和定制选项。</font></p>
                        <p align=left><font face=Verdana>　　四、其他措施</font></p>
                        <p align=left><font face=Verdana>　　1.隐藏邮件服务器IP地址</font></p>
                        <p align=left><font face=Verdana>　　如果网络中有专门发送邮件的中央邮件服务器，为许多主机提供访问，那么必须隐藏邮件地址的主机名部分，（以postfix邮件服务器为例）例如一条名为：pc-jok.cao.com的主机上有一个jok用户那么它的邮件名称是：<a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#106;&#111;&#107;&#64;&#112;&#99;&#45;&#106;&#111;&#107;&#46;&#99;&#97;&#111;&#46;&#99;&#111;&#109;"><font color=#000000>jok@pc-jok.cao.com</font></a> main.cf加入两行：</font></p>
                        <p align=left><font face=Verdana>masquerade_domain=$mydomian</font></p>
                        <p align=left><font face=Verdana>masquerade_exceptions=root</font></p>
                        <p align=left><font face=Verdana>　　第一行通知postfix邮件服务器对所在德 域允许地址化装，通过$mydomian变量完成，这样jok@pc-jok.cao.com变为jok@cao.com，第二行将root用户排除，即不对root用户伪装。</font></p>
                        <p align=left><font face=Verdana>　　&nbsp;2.防范DOS攻击：</font></p>
                        <p align=left><font face=Verdana>　　DOS（拒绝服务攻击）一段时间以来成为许多单位邮件服务器的最大杀手。对于邮件服务器的拒绝服务攻击原理很简单，就是不断地向邮件服务器发送大量的邮件，直到超过最大容量而崩溃为止。拒绝服务攻击有时并非有针对性的黑客行为，现在的病毒常常会利用自身的SMTP引擎，向感染电脑里的存在的地址狂发大量邮件。如果中小企业认为自己的公司小，不会成为攻击目标，这种想法已经不现实了。对于中小企业来说，要预防DOS攻击比大型企业要容易，因为小型企业往往不会有太多的邮件来往，我们可以根据业务量的大小，限制每个连接的邮件数，以及每封邮件的收件人数。这样，用户对于DOS攻击就可以做到尽早地发现并采取措施，而不会等到服务器崩溃的时候才发现被人实施了DOS攻击。步骤如下：</font></p>
                        <p align=left><font face=Verdana>　　2. 限制服务器使用的进程数目</font></p>
                        <p align=left><font face=Verdana>　　可以通过指定/etc/postfix/main.cf文件的下列参数来控制使用的并发进程总量：</font></p>
                        <p align=left><font face=Verdana>　　default_process_limit = 50 </font></p>
                        <p align=left><font face=Verdana>　　这样服务器被允许同时允许60个并发进程（例如smtp客户端、smtp服务器端和本地分发）。如果希望增加同时接受1000条信息，可以修改 /etc/postfix/ master.cf文件，使smtp服务的最大进程达到1000,如下所示：</font></p>
                        <p align=left><font face=Verdana>#============================================================= </font></p>
                        <p align=left><font face=Verdana># service type private unpriv chroot wakeup maxproc command + args </font></p>
                        <p align=left><font face=Verdana># (yes) (yes) (yes) (never) (60) </font></p>
                        <p align=left><font face=Verdana># =========================================== </font></p>
                        <p align=left><font face=Verdana>smtp inet n - n - 1000 smtpd </font></p>
                        <p align=left><font face=Verdana>&nbsp;　　3.控制最大邮件尺寸</font></p>
                        <p align=left><font face=Verdana>可以修改/etc/postfix/main.cf如下参数控制邮件尺寸 </font></p>
                        <p align=left><font face=Verdana>message_size_limit = 1073741824</font></p>
                        <p align=left><font face=Verdana>这样服务器可以处理最大邮件尺寸是1073741824字节 (10兆).</font></p>
                        <p align=left><font face=Verdana>　　4. 控制同时发送一个远程服务器的邮件数量 </font></p>
                        <p align=left><font face=Verdana>同时向远程服务器发送太多SMTP连接是不合理的，也是危险的（可能会被认为是<br>发送垃圾邮件）。</font><font face=Verdana>一些大的ISP站点（AOL、 Yahoo!、 Hotmail）通常要求优<br>化等到许可才能使用发送并发连接。Postfix 也能通过下面参数设定一个站点的最<br>大并发连接数量： </font></p>
                        <p align=left><font face=Verdana>default_destination_concurrency_limit = 20 </font></p>
                        <p align=left><font face=Verdana>&nbsp;这样使到达单一站点的并发连接数量不能超过20个。</font></p>
                        <p align=left><font face=Verdana>　　5.安装防病毒软件：</font></p>
                        <p align=left><font face=Verdana>F-Prot Antivirus软件包安装和配置过程：软件包格式： fp-linux-ws.rpm</font></p>
                        <p align=left><font face=Verdana>软件包的大小（KB）：3970KB，下载地址：<br>http://files.f-prot.com/files/linux-x86/fp-linux-ws.rpm</font></p>
                        <p align=left><font face=Verdana>安装F-Prot Antivirus软件包前，请先启动SpamAssassin服务器：</font></p>
                        <p align=left><font face=Verdana>Wget&nbsp; http://files.f-prot.com/files/linux-x86/fp-linux-ws.rpm</font></p>
                        <p align=left><font face=Verdana>Wget －ivh fp-linux-ws.rpm</font></p>
                        <p align=left><font face=Verdana>&nbsp;升级的F-Prot Antivirus病毒库的操作：</font></p>
                        <p align=left><font face=Verdana># cd /usr/local/f-prot/tools/</font></p>
                        <p align=left><font face=Verdana># ./check-updates.pl （升级命令）</font></p>
                        <p align=left><font face=Verdana>***************************************</font></p>
                        <p align=left><font face=Verdana>* F-Prot Antivirus Updater&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *</font></p>
                        <p align=left><font face=Verdana>***************************************</font></p>
                        <p align=left><font face=Verdana>Nothing to be done...</font></p>
                        <p align=left><font face=Verdana>　　总结：Postfix是目前比较流行的，拥有相当好的安全性和高效率的邮件系统。<br>Postfix自身带了很多反垃圾邮件的功能可以阻止一部</font></p>
                        </font></span></div>
                        </div>
                        </td>
                    </tr>
                </tbody>
            </table>
            </td>
        </tr>
    </tbody>
</table>
<img src ="http://www.cnitblog.com/snfnvtk/aggbug/46493.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/snfnvtk/" target="_blank">network</a> 2008-07-09 16:22 <a href="http://www.cnitblog.com/snfnvtk/archive/2008/07/09/46493.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>RAR for linux 命令详解</title><link>http://www.cnitblog.com/snfnvtk/archive/2008/06/29/46134.html</link><dc:creator>network</dc:creator><author>network</author><pubDate>Sun, 29 Jun 2008 12:18:00 GMT</pubDate><guid>http://www.cnitblog.com/snfnvtk/archive/2008/06/29/46134.html</guid><wfw:comment>http://www.cnitblog.com/snfnvtk/comments/46134.html</wfw:comment><comments>http://www.cnitblog.com/snfnvtk/archive/2008/06/29/46134.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/snfnvtk/comments/commentRss/46134.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/snfnvtk/services/trackbacks/46134.html</trackback:ping><description><![CDATA[<div class=Section0 style="LAYOUT-GRID:  15.6pt none">
<table style="BORDER-COLLAPSE: collapse; mso-table-layout-alt: fixed">
    <tbody>
        <tr>
            <td style="PADDING-RIGHT: 5.4pt; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0pt; WIDTH: 426.1pt; PADDING-TOP: 0pt" vAlign=top width=568>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'"><font face=宋体>命令格式：&nbsp;rar&nbsp;&lt;command&gt;&nbsp;-&lt;swith&nbsp;1&gt;&nbsp;-&lt;swith&nbsp;N&gt;&nbsp;&lt;archive&gt;&nbsp;&lt;files...&gt;&nbsp;&lt;@listfiles...&gt;&nbsp;&lt;path_to_extract\&gt;</font></span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="MARGIN-TOP: 5pt; MARGIN-BOTTOM: 5pt"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">&lt;Commands&gt;</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">a&nbsp;向压缩包中添加文件</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">c&nbsp;添加压缩注释</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">cf&nbsp;添加文件注释</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">cw&nbsp;向文件中写压缩注释</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">d&nbsp;从压缩包中删除文件</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">e&nbsp;在当前目录下解压缩文件</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">f&nbsp;刷新压缩文件中的文件</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">i[par]=&lt;str&gt;&nbsp;在压缩包中查找指定字符串</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">k&nbsp;锁住压缩包</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">l[t,b]&nbsp;列出压缩包的内容[t(technical)详细列表，b(bare)简单列表]</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">m[f]&nbsp;向压缩包里移动内容[f(files&nbsp;only)只移动文件]</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">p&nbsp;在标准输出上打印文件内容</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">r&nbsp;修复压缩包</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">rc&nbsp;修复丢失卷</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">rn&nbsp;重命名压缩的文件</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">rr[N]&nbsp;添加数据恢复记录</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">rv[N]&nbsp;创建恢复卷</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">s[name|-]&nbsp;将压缩包转换为自解压文件，或从自解压文件转换为压缩包</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">t&nbsp;测试压缩文件</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">u&nbsp;更新压缩包中的文件</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">v[t,b]&nbsp;列出压缩包中文件(冗长型)[t(technical)详细列表，b(bare)简单列表]</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">x&nbsp;以全路径方式解压文件</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="MARGIN-TOP: 5pt; MARGIN-BOTTOM: 5pt"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">&lt;Switches&gt;</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">-&nbsp;停止switches扫描</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">ad&nbsp;在目的路径后添加压缩文件名</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">ag[format]&nbsp;用当前日期生成压缩文件名</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">ap&lt;path&gt;&nbsp;设置压缩包内部的路径</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">as&nbsp;同步压缩内容</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">av&nbsp;设置授权认证(注册版功能)</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">av-&nbsp;禁用授权认证检查</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">c-&nbsp;禁止内容显示</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">cfg-&nbsp;不读取设置</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">cl&nbsp;将名称转换为小写</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">cu&nbsp;将名称转换为大写</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">df&nbsp;在压缩完成后删除源文件</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">dh&nbsp;打开共享文件</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">ds&nbsp;对于固实压缩包，禁用名称排序</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">e&lt;attr&gt;&nbsp;设置文件不包含的属性</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">ed&nbsp;不添加空目录</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">en&nbsp;不设置&#8216;压缩文件尾标志&#8217;块</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">ep&nbsp;在名称中去掉路径</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">ep1&nbsp;在名称中去掉基本路径</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">ep2&nbsp;展开全路径</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">f&nbsp;刷新文件</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">hp[password]&nbsp;对文件数据和文件头都进行加密</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">idp&nbsp;禁用百分比显示</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">ierr&nbsp;给标准错误输出发送所有信息</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">ilog[name]&nbsp;生成错误日志文件(注册版功能)</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">inul&nbsp;禁用所有信息</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">isnd&nbsp;启用声效</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">k&nbsp;锁住压缩包</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">kb&nbsp;保留破损的解压文件</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">m&lt;0..5&gt;&nbsp;设置压缩率(0-存储...3-默认...5-最大)</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">mc&lt;par&gt;&nbsp;设置高级压缩参数</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">md&lt;size&gt;&nbsp;以KB显示大小(64,128,256,512,1024,2048,4096&nbsp;或者A-G)</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">ms[ext;ext]&nbsp;指定存储的文件类型</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">o+&nbsp;覆盖已存在文件</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">o-&nbsp;不覆盖已存在文件</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">ol&nbsp;将符号链接保存为链接而不是文件</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">ow&nbsp;保存或恢复文件属主/组</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">p[password]&nbsp;设置密码</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">p-&nbsp;不查询密码</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">r&nbsp;对子目录内容循环</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">r0&nbsp;只对通配符进行子目录内容循环</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">rr[N]&nbsp;添加数据恢复记录</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">rv[N]&nbsp;创建恢复卷</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">s[&lt;N&gt;,v[-],e]&nbsp;创建固实压缩包</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">s-&nbsp;禁用固实压缩</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">sfx[name]&nbsp;创建自解压压缩包</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">t&nbsp;压缩后进行解压测试</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">ta&lt;date&gt;&nbsp;处理在&lt;date&gt;(YYYYMMDDHHMMSS格式)日期后修改的文件</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">tb&lt;date&gt;&nbsp;处理在&lt;date&gt;(YYYYMMDDHHMMSS格式)日期前修改的文件</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">tk&nbsp;保留初始压缩时间</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">tl&nbsp;设置压缩时间为最新文件的时间</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">tn&lt;time&gt;&nbsp;处理在&lt;time&gt;时间后修改的文件</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">to&lt;time&gt;&nbsp;处理在&lt;time&gt;时间前修改的文件</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">ts&lt;m,c,a&gt;[N]&nbsp;保存或恢复文件时间(修改，创建，访问)</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">u&nbsp;更新文件</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">v&nbsp;以自动分卷大小分卷压缩，或列出所有分卷</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">v&lt;size&gt;[k,b]&nbsp;以&lt;size&gt;*1000大小分卷压缩[k-*1024,&nbsp;b-*1]</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">ver[n]&nbsp;文件版本控制</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">vn&nbsp;使用旧的分卷命名方式</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">vp&nbsp;每次分卷前暂停</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">w&lt;path&gt;&nbsp;设置工作目录</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">x&lt;file&gt;&nbsp;排除指定文件</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">x@&nbsp;从标准输入中读取要排除的文件名</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">x@&lt;list&gt;&nbsp;排除列表文件中指定的文件</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">y&nbsp;对所有问题均回复yes</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">z&lt;file&gt;&nbsp;从文件中读取压缩包内容</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="MARGIN-TOP: 5pt; MARGIN-BOTTOM: 5pt"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">============================================</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">查看压缩包中的文件</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">$rar&nbsp;l&nbsp;XXX.rar&nbsp;或者&nbsp;$rar&nbsp;v&nbsp;XXX.rar</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="MARGIN-TOP: 5pt; MARGIN-BOTTOM: 5pt"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">查看压缩包中的文件(只看有什么文件)</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">$rar&nbsp;lb&nbsp;XXX.rar&nbsp;或者&nbsp;$rar&nbsp;vb&nbsp;XXX.rar</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="MARGIN-TOP: 5pt; MARGIN-BOTTOM: 5pt"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">查看压缩包中的文件(详细信息)</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">$rar&nbsp;lt&nbsp;XXX.rar&nbsp;或者&nbsp;$rar&nbsp;vt&nbsp;XXX.rar</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">============================================</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">把压缩包的内容解压到当前目录</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">$rar&nbsp;e&nbsp;XXX.rar</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="MARGIN-TOP: 5pt; MARGIN-BOTTOM: 5pt"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">把压缩包的内容解压到指定目录，比如/home/yxd/tmp/下面</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">$rar&nbsp;e&nbsp;XXX.rar&nbsp;/home/yxd/tmp/</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="MARGIN-TOP: 5pt; MARGIN-BOTTOM: 5pt"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">把压缩包解的内容压到指定目录，比如/home/yxd/tmp/下面，包含压缩包中的路径</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">$rar&nbsp;x&nbsp;XXX.rar&nbsp;/home/yxd/tmp/</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">============================================</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">压缩指定的一个文件，比如aaa，以默认压缩率</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">$rar&nbsp;a&nbsp;XXX.rar&nbsp;aaa</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="MARGIN-TOP: 5pt; MARGIN-BOTTOM: 5pt"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">压缩指定的一个文件，比如aaa，以最大压缩率</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">$rar&nbsp;a&nbsp;-m5&nbsp;XXX.rar&nbsp;aaa</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="MARGIN-TOP: 5pt; MARGIN-BOTTOM: 5pt"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">压缩指定的一个目录下的所有文件，比如ddd目录下的所有文件</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">$rar&nbsp;a&nbsp;XXX.rar&nbsp;ddd/</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="MARGIN-TOP: 5pt; MARGIN-BOTTOM: 5pt"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">压缩指定的一个目录下的所有文件，比如ddd目录下的所有文件和所有子目录</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">$rar&nbsp;a&nbsp;-r&nbsp;XXX.rar&nbsp;ddd/</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="MARGIN-TOP: 5pt; MARGIN-BOTTOM: 5pt"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">压缩指定的一个目录下的所有文件，比如ddd目录下的所有文件和所有子目录，但是不包含空目录</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">$rar&nbsp;a&nbsp;-r&nbsp;-ed&nbsp;XXX.rar&nbsp;ddd/</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="MARGIN-TOP: 5pt; MARGIN-BOTTOM: 5pt"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">压缩指定的一个目录下的所有文件，比如ddd目录，连目录也一起压缩，包括子目录</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">$rar&nbsp;a&nbsp;XXX.rar&nbsp;ddd</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="MARGIN-TOP: 5pt; MARGIN-BOTTOM: 5pt"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">============================================</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">分卷压缩指定的一个文件，比如aaa，分卷大小为5000B</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">$rar&nbsp;a&nbsp;-v5&nbsp;XXX.rar&nbsp;aaa</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="MARGIN-TOP: 5pt; MARGIN-BOTTOM: 5pt"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">分卷压缩指定的一个文件，比如aaa，分卷大小为5k(5*1024B)</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">$rar&nbsp;a&nbsp;-v5k&nbsp;XXX.rar&nbsp;aaa</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="MARGIN-TOP: 5pt; MARGIN-BOTTOM: 5pt"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">分卷压缩指定的一个文件，比如aaa，分卷大小为5B</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">$rar&nbsp;a&nbsp;-v5b&nbsp;XXX.rar&nbsp;aaa</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">============================================</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">压缩指定文件并加密</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">rar&nbsp;a&nbsp;-p&nbsp;xxx.rar&nbsp;aaaa</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">给压缩文件加注解</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'">rar&nbsp;c&nbsp;xxx.rar&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;以&nbsp;Ctrl&nbsp;+&nbsp;d&nbsp;结束</span><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            <p class=0 style="MARGIN-TOP: 5pt; MARGIN-BOTTOM: 5pt"><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'"><o:p></o:p></span></p>
            </td>
        </tr>
    </tbody>
</table>
<p class=0><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Arial'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class=0><span style="FONT-SIZE: 10.5pt; COLOR: rgb(0,0,0); FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
</div>
<!--endfragment-->
<img src ="http://www.cnitblog.com/snfnvtk/aggbug/46134.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/snfnvtk/" target="_blank">network</a> 2008-06-29 20:18 <a href="http://www.cnitblog.com/snfnvtk/archive/2008/06/29/46134.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>linux下的rar安装</title><link>http://www.cnitblog.com/snfnvtk/archive/2008/06/29/46133.html</link><dc:creator>network</dc:creator><author>network</author><pubDate>Sun, 29 Jun 2008 12:16:00 GMT</pubDate><guid>http://www.cnitblog.com/snfnvtk/archive/2008/06/29/46133.html</guid><wfw:comment>http://www.cnitblog.com/snfnvtk/comments/46133.html</wfw:comment><comments>http://www.cnitblog.com/snfnvtk/archive/2008/06/29/46133.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/snfnvtk/comments/commentRss/46133.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/snfnvtk/services/trackbacks/46133.html</trackback:ping><description><![CDATA[<p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'">1<font face=宋体>。下载rarlinux-3.7.b1.tar.gz&nbsp;——&nbsp;</font></span><span style="FONT-WEIGHT: bold; FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'">rar</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'"><font face=宋体>的Linux版本。</font></span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'"><font face=宋体>地址：</font></span><span><a href="http://www.skycn.com/soft/3455.html"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; TEXT-DECORATION: underline; mso-spacerun: 'yes'"><font color=#0000ff>http://www.skycn.com/soft/3455.html</font></span></a></span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'"><font face=宋体>如果在Linux上可以使用wget下载文件。</font></span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'">2<font face=宋体>。上传到Liux服务器。</font></span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'">3<font face=宋体>。解压安装包：</font></span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'">#&nbsp;tar&nbsp;xvfz&nbsp;rarlinux-3.7.b1.tar.gz&nbsp;</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
# cd rar<br># make<br>#make install<br>这样就行了。我以为还有什么配置文件 还要启动呢&nbsp; 都不用 安装好的就行了 就可以用rar这个命令了 <br>很简单吧&nbsp; 不过如果遇到
<p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'">#&nbsp;</span><span style="FONT-WEIGHT: bold; FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'">rar</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'">&nbsp;x&nbsp;cussbak.</span><span style="FONT-WEIGHT: bold; FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'">rar</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'">&nbsp;cussbak/</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'"><o:p></o:p></span></p>
<p class=0><span style="FONT-WEIGHT: bold; FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'">rar</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'">:&nbsp;/lib/tls/libc.so.6:&nbsp;version&nbsp;`GLIBC_2.4'&nbsp;not&nbsp;found&nbsp;(required&nbsp;by&nbsp;</span><span style="FONT-WEIGHT: bold; FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'">rar</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'">)这样的问题<br></span></p>
<!--endfragment-->
<p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'"><font face=宋体>需要GLIBC_2.4。如果没有GLIBC_2.4可以</font></span></p>
<p class=0 style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'">#&nbsp;cp&nbsp;./</span><span style="FONT-WEIGHT: bold; FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'">rar</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'">/</span><span style="FONT-WEIGHT: bold; FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'">rar</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'">_static&nbsp;/usr/local/bin/</span><span style="FONT-WEIGHT: bold; FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'">rar</span></p>
<p class=0><span style="FONT-WEIGHT: bold; FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'">rar</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'">_static&nbsp;<font face=宋体>版是&nbsp;static&nbsp;linking&nbsp;版本，不会有&nbsp;glibc&nbsp;程式库版本不和的</font></span><span style="FONT-WEIGHT: bold; FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'"><font face=宋体>问题</font></span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-spacerun: 'yes'"><font face=宋体>。<br></font></span></p>
<!--endfragment--><br>恩 这样就行了 下面就是一些关于rar在linux里的 命令了<br><br><!--endfragment-->
<img src ="http://www.cnitblog.com/snfnvtk/aggbug/46133.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/snfnvtk/" target="_blank">network</a> 2008-06-29 20:16 <a href="http://www.cnitblog.com/snfnvtk/archive/2008/06/29/46133.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>深入理解软件包的配置</title><link>http://www.cnitblog.com/snfnvtk/archive/2008/06/29/46105.html</link><dc:creator>network</dc:creator><author>network</author><pubDate>Sun, 29 Jun 2008 03:06:00 GMT</pubDate><guid>http://www.cnitblog.com/snfnvtk/archive/2008/06/29/46105.html</guid><wfw:comment>http://www.cnitblog.com/snfnvtk/comments/46105.html</wfw:comment><comments>http://www.cnitblog.com/snfnvtk/archive/2008/06/29/46105.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/snfnvtk/comments/commentRss/46105.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/snfnvtk/services/trackbacks/46105.html</trackback:ping><description><![CDATA[<table style="BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
    <tbody>
        <tr>
            <td align=middle bgColor=#bbf0ff><font style="FONT-SIZE: 14pt" color=#000066><strong>深入理解软件包的配置、编译与安装(转)</strong></font> </td>
            <tr>
                <td>
                <table style="BORDER-COLLAPSE: collapse" borderColor=#bbf0ff cellSpacing=1 cellPadding=0 width="100%" border=1>
                    <tbody>
                        <tr>
                            <td align=middle>
                            <table style="BORDER-COLLAPSE: collapse; WORD-WRAP: break-word" cellSpacing=0 cellPadding=0 width=650 border=0>
                                <tbody>
                                    <tr>
                                        <td align=middle>
                                        <table style="BORDER-COLLAPSE: collapse; WORD-WRAP: break-word" cellSpacing=0 cellPadding=0 width="100%" border=0>
                                            <tbody>
                                                <tr>
                                                    <td width=650>
                                                    <div id=art style="MARGIN: 15px">
                                                    <div>作者：金步国
                                                    <div>&nbsp;</div>
                                                    <div><font color=#ff0000>前言</font></div>
                                                    <div>从源代码安装过软件的朋友一定对 ./configure &amp;&amp; make &amp;&amp; make install 安装三步曲非常熟悉了。然而究竟这个过程中的每一步幕后都发生了些什么呢？本文将带领你一探究竟。深入理解这个过程将有助于你在LFS的基础上玩出自己的花样来。不过需要说明的是本文对 Makefile 和 make 的讲解是相当近视和粗浅的，但是对于理解安装过程来说足够了。<br><font color=#ff0000></font></div>
                                                    <div><font color=#ff0000>概述</font></div>
                                                    <div>用一句话来解释这个过程就是：</div>
                                                    <div>根据源码包中 Makefile.in 文件的指示，configure 脚本检查当前的系统环境和配置选项，在当前目录中生成 Makefile 文件(还有其它本文无需关心的文件)，然后 make 程序就按照当前目录中的 Makefile 文件的指示将源代码编译为二进制文件，最后将这些二进制文件移动(即安装)到指定的地方(仍然按照 Makefile 文件的指示)。</div>
                                                    <div>由此可见 Makefile 文件是幕后的核心。要深入理解安装过程，必须首先对 Makefile 文件有充分的了解。本文将首先讲述 Makefile 与 make ，然后再讲述 configure 脚本。并且在讲述这两部分内容时，提供了尽可能详细的、可以运用于实践的参考资料。<br>Makefile 与 make</div>
                                                    <div>用一句话来概括Makefile 与 make 的关系就是：<br>Makefile 包含了所有的规则和目标，而 make 则是为了完成目标而去解释 Makefile 规则的工具。<br><font color=#ff0000>make 语法</font></div>
                                                    <div>首先看看 make 的命令行语法：</div>
                                                    <div>make [options] [targets] [VAR=VALUE]...</div>
                                                    <div>[options]是命令行选项，可以用 make --help 命令查看全部，[VAR=VALUE]是在命令行上指定环境变量，这两个大家都很熟悉，将在稍后详细讲解。而[targets]是什么呢？字面的意思是"目标"，也就是希望本次 make 命令所完成的任务。凭经验猜测，这个[targets]大概可以用"ckeck","install"之类(也就是常见的测试和安装命令)。但是它到底是个啥玩意儿？不带任何"目标"的 make 命令是什么意思？为什么在安装 LFS 工具链中的 Perl-5.8.8 软件包时会出现"make perl utilities"这样怪异的命令？要回答这些问题必须首先理解 Makefile 文件中的"规则"。 <br><font color=#ff0000>Makefile 规则</font></div>
                                                    <div>Makefile 规则包含了文件之间的依赖关系和更新此规则目标所需要的命令。</div>
                                                    <div>一个简单的 Makefile 规则是这样写的：<br>TARGET : PREREQUISITES<br>&nbsp;COMMAND<br>TARGET<br>规则的目标。也就是可以被 make 使用的"目标"。有些目标可以没有依赖而只有动作(命令行)，比如"clean"，通常仅仅定义一系列删除中间文件的命令。同样，有些目标可以没有动作而只有依赖，比如"all"，通常仅仅用作"终极目标"。<br>PREREQUISITES<br>规则的依赖。通常一个目标依赖于一个或者多个文件。<br>COMMAND<br>规则的命令行。一个规则可以有零个或多个命令行。</div>
                                                    <div>OK! 现在你明白[targets]是什么了，原来它们来自于 Makefile 文件中一条条规则的目标(TARGET)。另外，Makefile文件中第一条规则的目标被称为"终极目标"，也就是你省略[targets]参数时的目标(通常为"all")。</div>
                                                    <div>当你查看一个实际的 Makefile 文件时，你会发现有些规则非常复杂，但是它都符合规则的基本格式。此外，Makefile 文件中通常还包含了除规则以外的其它很多东西，不过本文只关心其中的变量。<br>Makefile 变量</div>
                                                    <div>Makefile 中的"变量"更像是 C 语言中的宏，代表一个文本字符串(变量的值)，可以用于规则的任何部分。变量的定义很简单：VAR=VALUE；变量的引用也很简单：$(VAR) 或者 ${VAR}。变量引用的展开过程是严格的文本替换过程，就是说变量值的字符串被精确的展开在变量被引用的地方。比如，若定义：VAR=c，那么，"$(VAR) $(VAR)-$(VAR) VAR.$(VAR)"将被展开为"c c-c VAR.c"。</div>
                                                    <div>虽然在 Makefile 中可以直接使用系统的环境变量，但是也可以通过在 Makefile 中定义同名变量来"遮盖"系统的环境变量。另一方面，我们可以在调用 make 时使用 -e 参数强制使系统中的环境变量覆盖 Makefile 中的同名变量，除此之外，在调用 make 的命令行上使用 VAR=VALUE 格式指定的环境变量也可以覆盖 Makefile 中的同名变量。<br>Makefile 实例</div>
                                                    <div>下面看一个简单的、实际的Makefile文件：<br>CC=gcc<br>CPPFLAGS=<br>CFLAGS=-O2 -pipe<br>LDFLAGS=-s<br>PREFIX=/usr</div>
                                                    <div>all : prog1 prog2</div>
                                                    <div>prog1 : prog1.o<br>&nbsp;$(CC) $(LDFLAGS) -o prog1 prog1.o</div>
                                                    <div>prog1.o : prog1.c<br>&nbsp;$(CC) -c $(CFLAGS) prog1.c</div>
                                                    <div>prog2 : prog2.o<br>&nbsp;$(CC) $(CFLAGS) $(LDFLAGS) -o prog2 prog2.o</div>
                                                    <div>prog2.o : prog2.c<br>&nbsp;$(CC) -c $(CPPFLAGS) $(CFLAGS) prog2.c</div>
                                                    <div>clean :<br>&nbsp;rm -f *.{o,a} prog{1,2}</div>
                                                    <div>install : prog1 prog2<br>&nbsp;if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi<br>&nbsp;cp -f prog1 $(PREFIX)/bin/prog1<br>&nbsp;cp -f prog2 $(PREFIX)/bin/prog2</div>
                                                    <div>check test : prog1 prog2<br>&nbsp;prog1 &lt; sample1.ref &gt; sample1.rz<br>&nbsp;prog1 &lt; sample2.ref &gt; sample3.rz<br>&nbsp;cmp sample1.ok sample1.rz<br>&nbsp;cmp sample2.ok sample2.rz</div>
                                                    <div>从中可以看出，make 与 make all 以及 make prog1 prog2 三条命令其实是等价的。而常用的 make check 和 make install 也找到了归属。同时我们也看到了 Makefile 中的各种变量是如何影响编译的。针对这个特定的 Makefile ，你甚至可以省略安装三步曲中的 make 命令而直接使用 make install 进行安装。</div>
                                                    <div>同样，为了使用自定义的编译参数编译 prog2 ，我们可以使用 make prog2 CFLAGS="-O3 -march=athlon64" 或 CFLAGS="-O3 -march=athlon64" &amp;&amp; make -e prog2 命令达到此目的。<br>Makefile 惯例</div>
                                                    <div>下面是Makefile中一些约定俗成的<font color=#ff0000>目标名称</font>及其含义：<br>all<br>编译整个软件包，但不重建任何文档。一般此目标作为默认的终极目标。此目标一般对所有源程序的编译和连接使用"-g"选项，以使最终的可执行程序中包含调试信息。可使用 strip 程序去掉这些调试符号。<br>clean<br>清除当前目录下在 make 过程中产生的文件。它不能删除软件包的配置文件，也不能删除 build 时创建的那些文件。<br>distclean<br>类似于"clean"，但增加删除当前目录下的的配置文件、build 过程产生的文件。<br>info<br>产生必要的 Info 文档。<br>check 或 test<br>完成所有的自检功能。在执行检查之前，应确保所有程序已经被创建(但可以尚未安装)。为了进行测试，需要实现在程序没有安装的情况下被执行的测试命令。<br>install<br>完成程序的编译并将最终的可执行程序、库文件等拷贝到指定的目录。此种安装一般不对可执行程序进行 strip 操作。<br>install-strip<br>和"install"类似，但是会对复制到安装目录下的可执行文件进行 strip 操作。<br>uninstall<br>删除所有由"install"安装的文件。<br>installcheck<br>执行安装检查。在执行安装检查之前，需要确保所有程序已经被创建并且被安装。<br>installdirs<br>创建安装目录及其子目录。它不能更改软件的编译目录，而仅仅是创建程序的安装目录。</div>
                                                    <div>下面是 Makefile 中一些约定俗成的<font color=#ff0000>变量名称</font>及其含义：</div>
                                                    <div>这些约定俗成的变量分为三类。第一类代表可执行程序的名字，例如 CC 代表编译器这个可执行程序；第二类代表程序使用的参数(多个参数使用空格分开)，例如 CFLAGS 代表编译器执行时使用的参数(一种怪异的做法是直接在 CC 中包含参数)；第三类代表安装目录，例如 prefix 等等，含义简单，下面只列出它们的默认值。<br>AR&nbsp;&nbsp; 函数库打包程序，可创建静态库.a文档。默认是"ar"。<br>AS&nbsp;&nbsp; 汇编程序。默认是"as"。<br>CC&nbsp;&nbsp; C编译程序。默认是"cc"。<br>CXX&nbsp; C++编译程序。默认是"g++"。<br>CPP&nbsp; C/C++预处理器。默认是"$(CC) -E"。<br>FC&nbsp;&nbsp; Fortran编译器。默认是"f77"。<br>PC&nbsp;&nbsp; Pascal语言编译器。默认是"pc"。<br>YACC Yacc文法分析器。默认是"yacc"。</div>
                                                    <div>ARFLAGS&nbsp;&nbsp;&nbsp;&nbsp; 函数库打包程序的命令行参数。默认值是"rv"。<br>ASFLAGS&nbsp;&nbsp;&nbsp;&nbsp; 汇编程序的命令行参数。<br>CFLAGS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C编译程序的命令行参数。<br>CXXFLAGS&nbsp;&nbsp;&nbsp; C++编译程序的命令行参数。<br>CPPFLAGS&nbsp;&nbsp;&nbsp; C/C++预处理器的命令行参数。<br>FFLAGS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Fortran编译器的命令行参数。<br>PFLAGS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Pascal编译器的命令行参数。<br>YFLAGS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Yacc文法分析器的命令行参数。<br>LDFLAGS&nbsp;&nbsp;&nbsp;&nbsp; 链接器的命令行参数。</div>
                                                    <div>prefix&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /usr/local<br>exec_prefix $(prefix)<br>bindir&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $(exec_prefix)/bin<br>sbindir&nbsp;&nbsp;&nbsp;&nbsp; $(exec_prefix)/sbin<br>libexecdir&nbsp; $(exec_prefix)/libexec<br>datadir&nbsp;&nbsp;&nbsp;&nbsp; $(prefix)/share<br>sysconfdir&nbsp; $(prefix)/etc<br>sharedstatedir $(prefix)/com<br>localstatedir&nbsp; $(prefix)/var<br>libdir&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $(exec_prefix)/lib<br>infodir&nbsp;&nbsp;&nbsp;&nbsp; $(prefix)/info<br>includedir&nbsp; $(prefix)/include<br>oldincludedir&nbsp; $(prefix)/include<br>mandir&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $(prefix)/man<br>srcdir&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 需要编译的源文件所在的目录，无默认值<br>make 选项</div>
                                                    <div>最后说说 make 的<font color=#ff0000>命令行选项</font>(以Make-3.81版本为准)：<br>-B, --always-make<br>无条件的重建所有规则的目标，而不是根据规则的依赖关系决定是否重建某些目标文件。<br>-C DIR, --directory=DIR<br>在做任何动作之前先切换工作目录到 DIR ，然后再执行 make 程序。<br>-d<br>在 make 执行过程中打印出所有的调试信息。包括：make 认为那些文件需要重建；那些文件需要比较它们的最后修改时间、比较的结果；重建目标所要执行的命令；使用的隐含规则等。使用该选项我们可以看到 make 构造依赖关系链、重建目标过程的所有信息，它等效于"-debug=a"。<br>--debug=FLAGS<br>在 make 执行过程中打印出调试信息。FLAGS 用于控制调试信息级别： <br>a<br>输出所有类型的调试信息<br>b<br>输出基本调试信息。包括：那些目标过期、是否重建成功过期目标文件。<br>v<br>除 b 级别以外还包括：解析的 makefile 文件名，不需要重建文件等。<br>i<br>除 b 级别以外还包括：所有使用到的隐含规则描述。<br>j<br>输出所有执行命令的子进程，包括命令执行的 PID 等。<br>m<br>输出 make 读取、更新、执行 makefile 的信息。<br>-e, --environment-overrides<br>使用系统环境变量的定义覆盖 Makefile 中的同名变量定义。<br>-f FILE, --file=FILE, --makefile=FILE<br>将 FILE 指定为 Makefile 文件。<br>-h, --help<br>打印帮助信息。<br>-i, --ignore-errors<br>忽略规则命令执行过程中的错误。<br>-I DIR, --include-dir=DIR<br>指定包含 Makefile 文件的搜索目录。使用多个"-I"指定目录时，搜索目录按照指定顺序进行。<br>-j [N], --jobs[=N]<br>指定并行执行的命令数目。在没有指定"-j"参数的情况下，执行的命令数目将是系统允许的最大可能数目。<br>-k, --keep-going<br>遇见命令执行错误时不终止 make 的执行，也就是尽可能执行所有的命令，直到出现致命错误才终止。<br>-l [N], --load-average[=N], --max-load[=N]<br>如果系统负荷超过 LOAD(浮点数)，不再启动新任务。<br>-L, --check-symlink-times<br>同时考察符号连接的时间戳和它所指向的目标文件的时间戳，以两者中较晚的时间戳为准。<br>-n, --just-print, --dry-run, --recon<br>只打印出所要执行的命令，但并不实际执行命令。<br>-o FILE, --old-file=FILE, --assume-old=FILE<br>即使相对于它的依赖已经过期也不重建 FILE 文件；同时也不重建依赖于此文件任何文件。<br>-p, --print-data-base<br>命令执行之前，打印出 make 读取的 Makefile 的所有数据（包括规则和变量的值），同时打印出 make 的版本信息。如果只需要打印这些数据信息，可以使用 make -qp 命令。查看 make 执行前的预设规则和变量，可使用命令 make &#8211;p -f /dev/null 。<br>-q, --question<br>"询问模式"。不运行任何命令，并且无输出，只是返回一个查询状态。返回状态为 0 表示没有目标需要重建，1 表示存在需要重建的目标，2 表示有错误发生。<br>-r, --no-builtin-rules<br>取消所有内嵌的隐含规则，不过你可以在 Makefile 中使用模式规则来定义规则。同时还会取消所有支持后追规则的隐含后缀列表，同样我们也可以在 Makefile 中使用".SUFFIXES"定义我们自己的后缀规则。此选项不会取消 make 内嵌的隐含变量。<br>-R, --no-builtin-variables<br>取消 make 内嵌的隐含变量，不过我们可以在 Makefile 中明确定义某些变量。注意，此选项同时打开了"-r"选项。因为隐含规则是以内嵌的隐含变量为基础的。<br>-s, --silent, --quiet<br>不显示所执行的命令。<br>-S, --no-keep-going, --stop<br>取消"-k"选项。在递归的 make 过程中子 make 通过 MAKEFLAGS 变量继承了上层的命令行选项。我们可以在子 make 中使用"-S"选项取消上层传递的"-k"选项，或者取消系统环境变量 MAKEFLAGS 中的"-k"选项。<br>-t, --touch<br>更新所有目标文件的时间戳到当前系统时间。防止 make 对所有过时目标文件的重建。<br>-v, --version<br>打印版本信息。<br>-w, --print-directory<br>在 make 进入一个目录之前打印工作目录。使用"-C"选项时默认打开这个选项。<br>--no-print-directory<br>取消"-w"选项。可以是用在递归的 make 调用过程中，取消"-C"参数将默认打开"-w"。<br>-W FILE, --what-if=FILE, --new-file=FILE, --assume-new=FILE<br>设定 FILE 文件的时间戳为当前时间，但不改变文件实际的最后修改时间。此选项主要是为实现了对所有依赖于 FILE 文件的目标的强制重建。<br>--warn-undefined-variables<br>在发现 Makefile 中存在对未定义的变量进行引用时给出告警信息。此功能可以帮助我们调试一个存在多级套嵌变量引用的复杂 Makefile 。但是：我们建议在书写 Makefile 时尽量避免超过三级以上的变量套嵌引用。<br>configure</div>
                                                    <div>此阶段的主要目的是生成 Makefile 文件，是最关键的运筹帷幄阶段，基本上所有可以对安装过程进行的个性化调整都集中在这一步。</div>
                                                    <div>configure 脚本能够对 Makefile 中的哪些内容产生影响呢？基本上可以这么说：所有内容，包括本文最关心的 Makefile 规则与 Makefile 变量。那么又是哪些因素影响着最终生成的 Makefile 文件呢？答曰：系统环境和配置选项。</div>
                                                    <div>配置选项的影响是显而易见的。但是"系统环境"的概念却很宽泛，包含很多方面内容，不过我们这里只关心环境变量，具体说来就是将来会在 Makefile 中使用到的环境变量以及与 Makefile 中的变量同名的环境变量。<br><font color=#ff0000>通用 configure 语法</font></div>
                                                    <div>在进一步讲述之前，先看看 configure 脚本的语法，一般有两种：</div>
                                                    <div>configure [OPTIONS] [VAR=VALUE]...</div>
                                                    <div>configure [OPTIONS] [HOST]</div>
                                                    <div>不管是哪种语法，我们都可以用 configure --help 查看所有可用的[OPTIONS]，并且通常在结尾部分还能看到这个脚本所关心的环境变量有哪些。在本文中将对这两种语法进行合并，使用下面这种简化的语法：</div>
                                                    <div>configure [OPTIONS]</div>
                                                    <div>这种语法能够被所有的 configure 脚本所识别，同时也能通过设置环境变量和使用特定的[OPTIONS]完成上述两种语法的一切功能。<br>通用 configure 选项</div>
                                                    <div>虽然每个软件包的 configure 脚本千差万别，但是它们却都有一些共同的选项，也基本上都遵守相同的选项语法。<br>脚本自身选项<br>--help<br>显示帮助信息。<br>--version<br>显示版本信息。<br>--cache-file=FILE<br>在FILE文件中缓存测试结果(默认禁用)。<br>--no-create<br>configure脚本运行结束后不输出结果文件，常用于正式编译前的测试。<br>--quiet, --silent<br>不显示脚本工作期间输出的"checking ..."消息。<br>目录选项<br>--srcdir=DIR<br>源代码文件所在目录，默认为configure脚本所在目录或其父目录。<br>--prefix=PREFIX<br>体系无关文件的顶级安装目录PREFIX ，默认值一般是 /usr/local 或 /usr/local/pkgName<br>--exec-prefix=EPREFIX<br>体系相关文件的顶级安装目录EPREFIX ，默认值一般是 PREFIX<br>--bindir=DIR<br>用户可执行文件的存放目录DIR ，默认值一般是 EPREFIX/bin<br>--sbindir=DIR<br>系统管理员可执行目录DIR ，默认值一般是 EPREFIX/sbin<br>--libexecdir=DIR<br>程序可执行目录DIR ，默认值一般是 EPREFIX/libexec<br>--datadir=DIR<br>通用数据文件的安装目录DIR ，默认值一般是 PREFIX/share<br>--sysconfdir=DIR<br>只读的单一机器数据目录DIR ，默认值一般是 PREFIX/etc<br>--sharedstatedir=DIR<br>可写的体系无关数据目录DIR ，默认值一般是 PREFIX/com<br>--localstatedir=DIR<br>可写的单一机器数据目录DIR ，默认值一般是 PREFIX/var<br>--libdir=DIR<br>库文件的安装目录DIR ，默认值一般是 EPREFIX/lib<br>--includedir=DIR<br>C头文件目录DIR ，默认值一般是 PREFIX/include<br>--oldincludedir=DIR<br>非gcc的C头文件目录DIR ，默认值一般是 /usr/include<br>--infodir=DIR<br>Info文档的安装目录DIR ，默认值一般是 PREFIX/info<br>--mandir=DIR<br>Man文档的安装目录DIR ，默认值一般是 PREFIX/man<br>体系结构选项</div>
                                                    <div>玩交叉编译的朋友对这些选项已经很熟悉了，并且对于通常的交叉编译情况而言，HOST == BUILD != TARGET 。但是对于不使用交叉编译的朋友也不必担心，将它们三个都设为相同即可。<br>--host=HOST<br>运行工具链的机器，默认是 config.guess 脚本的输出结果。<br>--build=BUILD<br>用来建立工具链的机器，默认值是 HOST<br>--target=TARGET<br>工具链所生成的二进制代码最终运行的机器，默认值是 HOST<br>特性选项<br>--enable-FEATURE<br>启用FEATURE特性<br>--disable-FEATURE<br>禁用FEATURE特性<br>--with-PACKAGE[=DIR]<br>启用附加软件包PACKAGE，亦可同时指定PACKAGE所在目录DIR<br>--without-PACKAGE<br>禁用附加软件包PACKAGE<br>通用环境变量</div>
                                                    <div>除了上述通用的选项外，下列环境变量影响着最终生成的 Makefile 文件：<br>CPP<br>C预处理器命令<br>CXXCPP<br>C++预处理器命令<br>CPPFLAGS<br>C/C++预处理器命令行参数<br>CC<br>C编译器命令<br>CFLAGS<br>C编译器命令行参数<br>CXX<br>C++编译器命令<br>CXXFLAGS<br>C++编译器命令行参数<br>LDFLAGS<br>连接器命令行参数</div>
                                                    <div>至于设置这些环境变量的方法，你可以将它们 export 为全局变量在全局范围内使用，也可以在命令行上使用 [VAR=VALUE]... configure [OPTIONS] 的语法局部使用。此处就不详细描述了。</div>
                                                    <div>看完上述内容以后，不用多说你应当自然而然的明白该进行如何对自己的软件包进行定制安装了。祝你好运</div>
                                                    </div>
                                                    </div>
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            </td>
                        </tr>
                    </tbody>
                </table>
                </td>
            </tr>
        </tbody>
    </table>
<img src ="http://www.cnitblog.com/snfnvtk/aggbug/46105.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/snfnvtk/" target="_blank">network</a> 2008-06-29 11:06 <a href="http://www.cnitblog.com/snfnvtk/archive/2008/06/29/46105.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>dhcp install</title><link>http://www.cnitblog.com/snfnvtk/archive/2008/06/18/45839.html</link><dc:creator>network</dc:creator><author>network</author><pubDate>Tue, 17 Jun 2008 16:37:00 GMT</pubDate><guid>http://www.cnitblog.com/snfnvtk/archive/2008/06/18/45839.html</guid><wfw:comment>http://www.cnitblog.com/snfnvtk/comments/45839.html</wfw:comment><comments>http://www.cnitblog.com/snfnvtk/archive/2008/06/18/45839.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/snfnvtk/comments/commentRss/45839.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/snfnvtk/services/trackbacks/45839.html</trackback:ping><description><![CDATA[<p>下载最新的dhcp***.tar.gz<br><br>&nbsp;cp dhpc***.tar.gz /tmp<br>&nbsp;&nbsp;&nbsp;tar xvzf dhcp***.tar.gz<br>&nbsp;&nbsp;&nbsp;cd dhcp***<br>&nbsp;&nbsp;&nbsp;./configure<br>&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;make<br>&nbsp;&nbsp;&nbsp;make install<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;cp&nbsp;server/dhcpd.conf&nbsp; /etc/<br>&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;/etc/init.d/dhcdbd start<br><br>&nbsp;开机启动<br>&nbsp;chkconfig --add&nbsp;dhcdbd<br>&nbsp;&nbsp;chkconfig --level&nbsp; 2345 dhcdbd on<br>&nbsp;<br>&nbsp;设置单域dhcp<br><br>vi /etc/dhcpd.conf<br><br>&nbsp; #option domain-name "example";<br><br>&nbsp;ddns-update-style ad-hoc<br><br>&nbsp;option domain-name-servers 192.168.1.1;<br><br>&nbsp;default-lease-time 600;<br>&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;max-lease-time 7200;<br><br>&nbsp;authoritative;<br><br>subnet 192.168.1.0 netmask 255.255.255.0 {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;range 192.168.1.10 192.168.1.200;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;option routers&nbsp;192.168.1.254;<br>&nbsp;&nbsp;&nbsp;}<br><br><br>&nbsp;更多配置,请查看dhcpd.conf<br><br><br>&nbsp;&nbsp;还有一个要注意的地方,<br><br>&nbsp;那就是以tar安装的包..在/tmp/dhcp***/server/dhcpd.leases.5中有个说明,<br>&nbsp;需要一个DHCP&nbsp;Client database<br><br>dhcpd.leases - DHCP client lease database<br><br>有这样一段<br><br>hen dhcpd is first installed, there is no lease database.&nbsp;&nbsp; However,<br>dhcpd requires that a lease database be present before it will start.<br>To make the initial lease database, just create an empty file called<br>DBDIR/dhcpd.leases.&nbsp;&nbsp; You can do this with:<br>.PP<br>.nf<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; touch DBDIR/dhcpd.leases<br><br><br>&nbsp;所以在启动服务前最好在<br><br>&nbsp;/var/state/dhcp/ 目录下面新建一个dhcpd.leases<br><br>&nbsp;touch /var/state/dhcp/dhcpd.leases<br><br>另在/tmp/dhcp***/README&nbsp;中找到一段在LINUX下安装DHCP服务器的说明<br>如下:<br>&nbsp; LINUX: BROADCAST</p>
<p>If you are running a recent version of Linux, this won't be a problem,<br>but on older versions of Linux (kernel versions prior to 2.2), there<br>is a potential problem with the broadcast address being sent<br>incorrectly.</p>
<p>In order for dhcpd to work correctly with picky DHCP clients (e.g.,<br>Windows 95), it must be able to send packets with an IP destination<br>address of 255.255.255.255.&nbsp; Unfortunately, Linux changes an IP<br>destination of 255.255.255.255 into the local subnet broadcast address<br>(here, that's 192.5.5.223).</p>
<p>This isn't generally a problem on Linux 2.2 and later kernels, since<br>we completely bypass the Linux IP stack, but on old versions of Linux<br>2.1 and all versions of Linux prior to 2.1, it is a problem - pickier<br>DHCP clients connected to the same network as the ISC DHCP server or<br>ISC relay agent will not see messages from the DHCP server.&nbsp;&nbsp; It *is*<br>possible to run into trouble with this on Linux 2.2 and later if you<br>are running a verson of the DHCP server that was compiled on a Linux<br>2.0 system, though.</p>
<p>It is possible to work around this problem on some versions of Linux<br>by creating a host route from your network interface address to<br>255.255.255.255.&nbsp;&nbsp; The command you need to use to do this on Linux<br>varies from version to version.&nbsp;&nbsp; The easiest version is:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route add -host 255.255.255.255 dev eth0</p>
<p>On some older Linux systems, you will get an error if you try to do<br>this.&nbsp;&nbsp; On those systems, try adding the following entry to your<br>/etc/hosts file:</p>
<p>255.255.255.255 all-ones</p>
<p>Then, try:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route add -host all-ones dev eth0</p>
<p>Another route that has worked for some users is:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route add -net 255.255.255.0 dev eth0</p>
<p>If you are not using eth0 as your network interface, you should<br>specify the network interface you *are* using in your route command.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LINUX: IP BOOTP AGENT</p>
<p>Some versions of the Linux 2.1 kernel apparently prevent dhcpd from<br>working unless you enable it by doing the following:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo 1 &gt;/proc/sys/net/ipv4/ip_bootp_agent</p>
<p><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LINUX: MULTIPLE INTERFACES</p>
<p>Very old versions of the Linux kernel do not provide a networking API<br>that allows dhcpd to operate correctly if the system has more than one<br>broadcast network interface.&nbsp; However, Linux 2.0 kernels with version<br>numbers greater than or equal to 2.0.31 add an API feature: the<br>SO_BINDTODEVICE socket option.&nbsp; If SO_BINDTODEVICE is present, it is<br>possible for dhcpd to operate on Linux with more than one network<br>interface.&nbsp; In order to take advantage of this, you must be running a<br>2.0.31 or greater kernel, and you must have 2.0.31 or later system<br>headers installed *before* you build the DHCP Distribution.</p>
<p>We have heard reports that you must still add routes to 255.255.255.255<br>in order for the all-ones broadcast to work, even on 2.0.31 kernels.<br>In fact, you now need to add a route for each interface.&nbsp;&nbsp; Hopefully<br>the Linux kernel gurus will get this straight eventually.</p>
<p>Linux 2.1 and later kernels do not use SO_BINDTODEVICE or require the<br>broadcast address hack, but do support multiple interfaces, using the<br>Linux Packet Filter.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LINUX: 802.1q VLAN INTERFACES</p>
<p>If you're using 802.1q vlan interfaces on Linux, it is necessary to<br>vconfig the subinterface(s) to rewrite the 802.1q information out of<br>packets received by the dhcpd daemon via LPF:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vconfig set_flag eth1.523 1 1</p>
<p>Note that this may affect the performance of your system, since the<br>Linux kernel must rewrite packets received via this interface.&nbsp; For<br>more information, consult the vconfig man pages.<br><br><br>&nbsp;这个文件告诉我们..<br>It is possible to work around this problem on some versions of Linux<br>by creating a host route from your network interface address to<br>255.255.255.255.&nbsp;&nbsp; The command you need to use to do this on Linux<br>varies from version to version.&nbsp;&nbsp; The easiest version is<br><br>说明一些版本的LINUX上运行可能出再错误,我们需要添加一条<br>路由<br>&nbsp; route add -host 255.255.255.255 dev eth0<br><br>On some older Linux systems, you will get an error if you try to do<br>this.&nbsp;&nbsp; On those systems, try adding the following entry to your<br>/etc/hosts file:<br>255.255.255.255 all-ones&nbsp;<br><br>&nbsp;在一些老的版本的LINUX 可能会出现错误.所以我们得编辑<br>&nbsp;/etc/hosts<br>&nbsp;加入下面一行<br><br>255.255.255.255 all-ones&nbsp;(这个名字可以自己定义,方便记忆.你也可以写成255.255.255.255 dhcp.)<br><br>&nbsp;然后在添加路由的时候,你可以用下面的命令:<br><br>&nbsp;&nbsp;route add -host&nbsp;all-ones dev eth0;<br><br>Another route that has worked for some users is:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route add -net 255.255.255.0 dev eth0<br>If you are not using eth0 as your network interface, you should<br>specify the network interface you *are* using in your route command.<br><br>&nbsp;这个是说明是为了在你不使用eth0的时候.你可以用其它接口代替命令行中的接口.<br><br>&nbsp;Some versions of the Linux 2.1 kernel apparently prevent dhcpd from<br>working unless you enable it by doing the following:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo 1 &gt;/proc/sys/net/ipv4/ip_bootp_agent<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在现在新的版本里,可能用到的是<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo 1 &gt;/proc/sys/net/ipv4/ip_forward<br><br>&nbsp;有一些版本的内核可能不允许dhcp工作.你就得使用下面的命令<br>&nbsp; echo 1 &gt;/proc/sys/net/ipv4/ip_bootp_agent<br><br>&nbsp;端口多路复用问题.是针对一些老板本的内核.自己看着办吧!<br><br><br>最后就是一个802.1Q虚拟接口的问题....<br>没有研究过...<br>&nbsp;<br><br><br><br>&nbsp;<br><br>&nbsp;<br>&nbsp;&nbsp;<br><br><br>&nbsp;&nbsp;&nbsp;</p>
<img src ="http://www.cnitblog.com/snfnvtk/aggbug/45839.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/snfnvtk/" target="_blank">network</a> 2008-06-18 00:37 <a href="http://www.cnitblog.com/snfnvtk/archive/2008/06/18/45839.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>vsftp 安装过程</title><link>http://www.cnitblog.com/snfnvtk/archive/2008/06/12/45469.html</link><dc:creator>network</dc:creator><author>network</author><pubDate>Wed, 11 Jun 2008 16:16:00 GMT</pubDate><guid>http://www.cnitblog.com/snfnvtk/archive/2008/06/12/45469.html</guid><wfw:comment>http://www.cnitblog.com/snfnvtk/comments/45469.html</wfw:comment><comments>http://www.cnitblog.com/snfnvtk/archive/2008/06/12/45469.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/snfnvtk/comments/commentRss/45469.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/snfnvtk/services/trackbacks/45469.html</trackback:ping><description><![CDATA[<p>先下载最新的vsftp包.<br><br><br>&nbsp; tar -xvzf vsftp-****.tar.gz<br><br><br>&nbsp;cd vsftp0****<br><br>&nbsp;make<br>&nbsp;<br>&nbsp;make install<br>&nbsp;<br>&nbsp;cp vsftpd.conf&nbsp; /etc/vsftpd.conf<br></p>
&nbsp;创建/var/ftp目录.<br><br>&nbsp;groupadd ftp<br><br>&nbsp;useradd -g ftp&nbsp;-d /var/ftp ftp<br><br>&nbsp;<br><br>&nbsp;
<img src ="http://www.cnitblog.com/snfnvtk/aggbug/45469.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/snfnvtk/" target="_blank">network</a> 2008-06-12 00:16 <a href="http://www.cnitblog.com/snfnvtk/archive/2008/06/12/45469.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VSFTPD.CONF online </title><link>http://www.cnitblog.com/snfnvtk/archive/2008/06/11/45451.html</link><dc:creator>network</dc:creator><author>network</author><pubDate>Wed, 11 Jun 2008 13:09:00 GMT</pubDate><guid>http://www.cnitblog.com/snfnvtk/archive/2008/06/11/45451.html</guid><wfw:comment>http://www.cnitblog.com/snfnvtk/comments/45451.html</wfw:comment><comments>http://www.cnitblog.com/snfnvtk/archive/2008/06/11/45451.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/snfnvtk/comments/commentRss/45451.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/snfnvtk/services/trackbacks/45451.html</trackback:ping><description><![CDATA[<h1>VSFTPD.CONF</h1>
Section: File Formats (5)<br><a href="http://vsftpd.beasts.org/vsftpd_conf.html#index"><u><font color=#800080>Index</font></u></a> <a href="http://vsftpd.beasts.org/"><u><font color=#800080>Return to Main Contents</font></u></a>
<hr>
<a name=lbAB>&nbsp;</a>
<h2>NAME</h2>
vsftpd.conf - config file for vsftpd <a name=lbAC>&nbsp;</a>
<h2>DESCRIPTION</h2>
vsftpd.conf may be used to control various aspects of vsftpd's behaviour. By default, vsftpd looks for this file at the location <strong>/etc/vsftpd.conf</strong>. However, you may override this by specifying a command line argument to vsftpd. The command line argument is the pathname of the configuration file for vsftpd. This behaviour is useful because you may wish to use an advanced inetd such as <strong>xinetd</strong> to launch vsftpd with different configuration files on a per virtual host basis.
<p><a name=lbAD>&nbsp;</a>
<h2>FORMAT</h2>
The format of vsftpd.conf is very simple. Each line is either a comment or a directive. Comment lines start with a # and are ignored. A directive line has the format:
<p>option=value
<p>It is important to note that it is an error to put any space between the option, = and value.
<p>Each setting has a compiled in default which may be modified in the configuration file.
<p><a name=lbAE>&nbsp;</a>
<h2>BOOLEAN OPTIONS</h2>
Below is a list of boolean options. The value for a boolean option may be set to <strong>YES</strong> or <strong>NO</strong>.
<p>
<dl compact>
<dt><strong>allow_anon_ssl</strong>
<dd>Only applies if <strong>ssl_enable</strong> is active. If set to YES, anonymous users will be allowed to use secured SSL connections.
<p>Default: NO </p>
<dt><strong>anon_mkdir_write_enable</strong>
<dd>If set to YES, anonymous users will be permitted to create new directories under certain conditions. For this to work, the option <strong>write_enable</strong> must be activated, and the anonymous ftp user must have write permission on the parent directory.
<p>Default: NO </p>
<dt><strong>anon_other_write_enable</strong>
<dd>If set to YES, anonymous users will be permitted to perform write operations other than upload and create directory, such as deletion and renaming. This is generally not recommended but included for completeness.
<p>Default: NO </p>
<dt><strong>anon_upload_enable</strong>
<dd>If set to YES, anonymous users will be permitted to upload files under certain conditions. For this to work, the option <strong>write_enable</strong> must be activated, and the anonymous ftp user must have write permission on desired upload locations.
<p>Default: NO </p>
<dt><strong>anon_world_readable_only</strong>
<dd>When enabled, anonymous users will only be allowed to download files which are world readable. This is recognising that the ftp user may own files, especially in the presence of uploads.
<p>Default: YES </p>
<dt><strong>anonymous_enable</strong>
<dd>Controls whether anonymous logins are permitted or not. If enabled, both the usernames <strong>ftp</strong> and <strong>anonymous</strong> are recognised as anonymous logins.
<p>Default: YES </p>
<dt><strong>ascii_download_enable</strong>
<dd>When enabled, ASCII mode data transfers will be honoured on downloads.
<p>Default: NO </p>
<dt><strong>ascii_upload_enable</strong>
<dd>When enabled, ASCII mode data transfers will be honoured on uploads.
<p>Default: NO </p>
<dt><strong>async_abor_enable</strong>
<dd>When enabled, a special FTP command known as "async ABOR" will be enabled. Only ill advised FTP clients will use this feature. Additionally, this feature is awkward to handle, so it is disabled by default. Unfortunately, some FTP clients will hang when cancelling a transfer unless this feature is available, so you may wish to enable it.
<p>Default: NO </p>
<dt><strong>background</strong>
<dd>When enabled, and vsftpd is started in "listen" mode, vsftpd will background the listener process. i.e. control will immediately be returned to the shell which launched vsftpd.
<p>Default: NO </p>
<dt><strong>check_shell</strong>
<dd>Note! This option only has an effect for non-PAM builds of vsftpd. If disabled, vsftpd will not check /etc/shells for a valid user shell for local logins.
<p>Default: YES </p>
<dt><strong>chmod_enable</strong>
<dd>When enables, allows use of the SITE CHMOD command. NOTE! This only applies to local users. Anonymous users never get to use SITE CHMOD.
<p>Default: YES </p>
<dt><strong>chown_uploads</strong>
<dd>If enabled, all anonymously uploaded files will have the ownership changed to the user specified in the setting <strong>chown_username</strong>. This is useful from an administrative, and perhaps security, standpoint.
<p>Default: NO </p>
<dt><strong>chroot_list_enable</strong>
<dd>If activated, you may provide a list of local users who are placed in a chroot() jail in their home directory upon login. The meaning is slightly different if chroot_local_user is set to YES. In this case, the list becomes a list of users which are NOT to be placed in a chroot() jail. By default, the file containing this list is /etc/vsftpd.chroot_list, but you may override this with the <strong>chroot_list_file</strong> setting.
<p>Default: NO </p>
<dt><strong>chroot_local_user</strong>
<dd>If set to YES, local users will be (by default) placed in a chroot() jail in their home directory after login. <strong>Warning:</strong> This option has security implications, especially if the users have upload permission, or shell access. Only enable if you know what you are doing. Note that these security implications are not vsftpd specific. They apply to all FTP daemons which offer to put local users in chroot() jails.
<p>Default: NO </p>
<dt><strong>connect_from_port_20</strong>
<dd>This controls whether PORT style data connections use port 20 (ftp-data) on the server machine. For security reasons, some clients may insist that this is the case. Conversely, disabling this option enables vsftpd to run with slightly less privilege.
<p>Default: NO (but the sample config file enables it) </p>
<dt><strong>deny_email_enable</strong>
<dd>If activated, you may provide a list of anonymous password e-mail responses which cause login to be denied. By default, the file containing this list is /etc/vsftpd.banned_emails, but you may override this with the <strong>banned_email_file</strong> setting.
<p>Default: NO </p>
<dt><strong>dirlist_enable</strong>
<dd>If set to NO, all directory list commands will give permission denied.
<p>Default: YES </p>
<dt><strong>dirmessage_enable</strong>
<dd>If enabled, users of the FTP server can be shown messages when they first enter a new directory. By default, a directory is scanned for the file .message, but that may be overridden with the configuration setting <strong>message_file</strong>.
<p>Default: NO (but the sample config file enables it) </p>
<dt><strong>download_enable</strong>
<dd>If set to NO, all download requests will give permission denied.
<p>Default: YES </p>
<dt><strong>dual_log_enable</strong>
<dd>If enabled, two log files are generated in parallel, going by default to <strong>/var/log/xferlog</strong> and <strong>/var/log/vsftpd.log</strong>. The former is a wu-ftpd style transfer log, parseable by standard tools. The latter is vsftpd's own style log.
<p>Default: NO </p>
<dt><strong>force_dot_files</strong>
<dd>If activated, files and directories starting with . will be shown in directory listings even if the "a" flag was not used by the client. This override excludes the "." and ".." entries.
<p>Default: NO </p>
<dt><strong>force_local_data_ssl</strong>
<dd>Only applies if <strong>ssl_enable</strong> is activated. If activated, all non-anonymous logins are forced to use a secure SSL connection in order to send and receive data on data connections.
<p>Default: YES </p>
<dt><strong>force_local_logins_ssl</strong>
<dd>Only applies if <strong>ssl_enable</strong> is activated. If activated, all non-anonymous logins are forced to use a secure SSL connection in order to send the password.
<p>Default: YES </p>
<dt><strong>guest_enable</strong>
<dd>If enabled, all non-anonymous logins are classed as "guest" logins. A guest login is remapped to the user specified in the <strong>guest_username</strong> setting.
<p>Default: NO </p>
<dt><strong>hide_ids</strong>
<dd>If enabled, all user and group information in directory listings will be displayed as "ftp".
<p>Default: NO </p>
<dt><strong>listen</strong>
<dd>If enabled, vsftpd will run in standalone mode. This means that vsftpd must not be run from an inetd of some kind. Instead, the vsftpd executable is run once directly. vsftpd itself will then take care of listening for and handling incoming connections.
<p>Default: NO </p>
<dt><strong>listen_ipv6</strong>
<dd>Like the listen parameter, except vsftpd will listen on an IPv6 socket instead of an IPv4 one. This parameter and the listen parameter are mutually exclusive.
<p>Default: NO </p>
<dt><strong>local_enable</strong>
<dd>Controls whether local logins are permitted or not. If enabled, normal user accounts in /etc/passwd may be used to log in.
<p>Default: NO </p>
<dt><strong>log_ftp_protocol</strong>
<dd>When enabled, all FTP requests and responses are logged, providing the option xferlog_std_format is not enabled. Useful for debugging.
<p>Default: NO </p>
<dt><strong>ls_recurse_enable</strong>
<dd>When enabled, this setting will allow the use of "ls -R". This is a minor security risk, because a ls -R at the top level of a large site may consume a lot of resources.
<p>Default: NO </p>
<dt><strong>no_anon_password</strong>
<dd>When enabled, this prevents vsftpd from asking for an anonymous password - the anonymous user will log straight in.
<p>Default: NO </p>
<dt><strong>no_log_lock</strong>
<dd>When enabled, this prevents vsftpd from taking a file lock when writing to log files. This option should generally not be enabled. It exists to workaround operating system bugs such as the Solaris / Veritas filesystem combination which has been observed to sometimes exhibit hangs trying to lock log files.
<p>Default: NO </p>
<dt><strong>one_process_model</strong>
<dd>If you have a Linux 2.4 kernel, it is possible to use a different security model which only uses one process per connection. It is a less pure security model, but gains you performance. You really don't want to enable this unless you know what you are doing, and your site supports huge numbers of simultaneously connected users.
<p>Default: NO </p>
<dt><strong>passwd_chroot_enable</strong>
<dd>If enabled, along with <strong>chroot_local_user</strong> , then a chroot() jail location may be specified on a per-user basis. Each user's jail is derived from their home directory string in /etc/passwd. The occurrence of /./ in the home directory string denotes that the jail is at that particular location in the path.
<p>Default: NO </p>
<dt><strong>pasv_enable</strong>
<dd>Set to NO if you want to disallow the PASV method of obtaining a data connection.
<p>Default: YES </p>
<dt><strong>pasv_promiscuous</strong>
<dd>Set to YES if you want to disable the PASV security check that ensures the data connection originates from the same IP address as the control connection. Only enable if you know what you are doing! The only legitimate use for this is in some form of secure tunnelling scheme, or perhaps to facilitate FXP support.
<p>Default: NO </p>
<dt><strong>port_enable</strong>
<dd>Set to NO if you want to disallow the PORT method of obtaining a data connection.
<p>Default: YES </p>
<dt><strong>port_promiscuous</strong>
<dd>Set to YES if you want to disable the PORT security check that ensures that outgoing data connections can only connect to the client. Only enable if you know what you are doing!
<p>Default: NO </p>
<dt><strong>run_as_launching_user</strong>
<dd>Set to YES if you want vsftpd to run as the user which launched vsftpd. This is useful where root access is not available. MASSIVE WARNING! Do NOT enable this option unless you totally know what you are doing, as naive use of this option can create massive security problems. Specifically, vsftpd does not / cannot use chroot technology to restrict file access when this option is set (even if launched by root). A poor substitute could be to use a <strong>deny_file</strong> setting such as {/*,*..*}, but the reliability of this cannot compare to chroot, and should not be relied on. If using this option, many restrictions on other options apply. For example, options requiring privilege such as non-anonymous logins, upload ownership changing, connecting from port 20 and listen ports less than 1024 are not expected to work. Other options may be impacted.
<p>Default: NO </p>
<dt><strong>secure_email_list_enable</strong>
<dd>Set to YES if you want only a specified list of e-mail passwords for anonymous logins to be accepted. This is useful as a low-hassle way of restricting access to low-security content without needing virtual users. When enabled, anonymous logins are prevented unless the password provided is listed in the file specified by the <strong>email_password_file</strong> setting. The file format is one password per line, no extra whitespace. The default filename is /etc/vsftpd.email_passwords.
<p>Default: NO </p>
<dt><strong>session_support</strong>
<dd>This controls whether vsftpd attempts to maintain sessions for logins. If vsftpd is maintaining sessions, it will try and update utmp and wtmp. It will also open a pam_session if using PAM to authenticate, and only close this upon logout. You may wish to disable this if you do not need session logging, and you wish to give vsftpd more opportunity to run with less processes and / or less privilege. NOTE - utmp and wtmp support is only provided with PAM enabled builds.
<p>Default: NO </p>
<dt><strong>setproctitle_enable</strong>
<dd>If enabled, vsftpd will try and show session status information in the system process listing. In other words, the reported name of the process will change to reflect what a vsftpd session is doing (idle, downloading etc). You probably want to leave this off for security purposes.
<p>Default: NO </p>
<dt><strong>ssl_enable</strong>
<dd>If enabled, and vsftpd was compiled against OpenSSL, vsftpd will support secure connections via SSL. This applies to the control connection (including login) and also data connections. You'll need a client with SSL support too. NOTE!! Beware enabling this option. Only enable it if you need it. vsftpd can make no guarantees about the security of the OpenSSL libraries. By enabling this option, you are declaring that you trust the security of your installed OpenSSL library.
<p>Default: NO </p>
<dt><strong>ssl_sslv2</strong>
<dd>Only applies if <strong>ssl_enable</strong> is activated. If enabled, this option will permit SSL v2 protocol connections. TLS v1 connections are preferred.
<p>Default: NO </p>
<dt><strong>ssl_sslv3</strong>
<dd>Only applies if <strong>ssl_enable</strong> is activated. If enabled, this option will permit SSL v3 protocol connections. TLS v1 connections are preferred.
<p>Default: NO </p>
<dt><strong>ssl_tlsv1</strong>
<dd>Only applies if <strong>ssl_enable</strong> is activated. If enabled, this option will permit TLS v1 protocol connections. TLS v1 connections are preferred.
<p>Default: YES </p>
<dt><strong>syslog_enable</strong>
<dd>If enabled, then any log output which would have gone to /var/log/vsftpd.log goes to the system log instead. Logging is done under the FTPD facility.
<p>Default: NO </p>
<dt><strong>tcp_wrappers</strong>
<dd>If enabled, and vsftpd was compiled with tcp_wrappers support, incoming connections will be fed through tcp_wrappers access control. Furthermore, there is a mechanism for per-IP based configuration. If tcp_wrappers sets the VSFTPD_LOAD_CONF environment variable, then the vsftpd session will try and load the vsftpd configuration file specified in this variable.
<p>Default: NO </p>
<dt><strong>text_userdb_names</strong>
<dd>By default, numeric IDs are shown in the user and group fields of directory listings. You can get textual names by enabling this parameter. It is off by default for performance reasons.
<p>Default: NO </p>
<dt><strong>tilde_user_enable</strong>
<dd>If enabled, vsftpd will try and resolve pathnames such as ~chris/pics, i.e. a tilde followed by a username. Note that vsftpd will always resolve the pathnames ~ and ~/something (in this case the ~ resolves to the initial login directory). Note that ~user paths will only resolve if the file <strong>/etc/passwd</strong> may be found within the _current_ chroot() jail.
<p>Default: NO </p>
<dt><strong>use_localtime</strong>
<dd>If enabled, vsftpd will display directory listings with the time in your local time zone. The default is to display GMT. The times returned by the MDTM FTP command are also affected by this option.
<p>Default: NO </p>
<dt><strong>use_sendfile</strong>
<dd>An internal setting used for testing the relative benefit of using the sendfile() system call on your platform.
<p>Default: YES </p>
<dt><strong>userlist_deny</strong>
<dd>This option is examined if <strong>userlist_enable</strong> is activated. If you set this setting to NO, then users will be denied login unless they are explicitly listed in the file specified by <strong>userlist_file</strong>. When login is denied, the denial is issued before the user is asked for a password.
<p>Default: YES </p>
<dt><strong>userlist_enable</strong>
<dd>If enabled, vsftpd will load a list of usernames, from the filename given by <strong>userlist_file</strong>. If a user tries to log in using a name in this file, they will be denied before they are asked for a password. This may be useful in preventing cleartext passwords being transmitted. See also <strong>userlist_deny</strong>.
<p>Default: NO </p>
<dt><strong>virtual_use_local_privs</strong>
<dd>If enabled, virtual users will use the same privileges as local users. By default, virtual users will use the same privileges as anonymous users, which tends to be more restrictive (especially in terms of write access).
<p>Default: NO </p>
<dt><strong>write_enable</strong>
<dd>This controls whether any FTP commands which change the filesystem are allowed or not. These commands are: STOR, DELE, RNFR, RNTO, MKD, RMD, APPE and SITE.
<p>Default: NO </p>
<dt><strong>xferlog_enable</strong>
<dd>If enabled, a log file will be maintained detailling uploads and downloads. By default, this file will be placed at /var/log/vsftpd.log, but this location may be overridden using the configuration setting <strong>vsftpd_log_file</strong>.
<p>Default: NO (but the sample config file enables it) </p>
<dt><strong>xferlog_std_format</strong>
<dd>If enabled, the transfer log file will be written in standard xferlog format, as used by wu-ftpd. This is useful because you can reuse existing transfer statistics generators. The default format is more readable, however. The default location for this style of log file is /var/log/xferlog, but you may change it with the setting <strong>xferlog_file</strong>.
<p>Default: NO
<p>&#160;</p>
</dd></dl><a name=lbAF>&nbsp;</a>
<h2>NUMERIC OPTIONS</h2>
Below is a list of numeric options. A numeric option must be set to a non negative integer. Octal numbers are supported, for convenience of the umask options. To specify an octal number, use 0 as the first digit of the number.
<p>
<dl compact>
<dt><strong>accept_timeout</strong>
<dd>The timeout, in seconds, for a remote client to establish connection with a PASV style data connection.
<p>Default: 60 </p>
<dt><strong>anon_max_rate</strong>
<dd>The maximum data transfer rate permitted, in bytes per second, for anonymous clients.
<p>Default: 0 (unlimited) </p>
<dt><strong>anon_umask</strong>
<dd>The value that the umask for file creation is set to for anonymous users. NOTE! If you want to specify octal values, remember the "0" prefix otherwise the value will be treated as a base 10 integer!
<p>Default: 077 </p>
<dt><strong>connect_timeout</strong>
<dd>The timeout, in seconds, for a remote client to respond to our PORT style data connection.
<p>Default: 60 </p>
<dt><strong>data_connection_timeout</strong>
<dd>The timeout, in seconds, which is roughly the maximum time we permit data transfers to stall for with no progress. If the timeout triggers, the remote client is kicked off.
<p>Default: 300 </p>
<dt><strong>file_open_mode</strong>
<dd>The permissions with which uploaded files are created. Umasks are applied on top of this value. You may wish to change to 0777 if you want uploaded files to be executable.
<p>Default: 0666 </p>
<dt><strong>ftp_data_port</strong>
<dd>The port from which PORT style connections originate (as long as the poorly named <strong>connect_from_port_20</strong> is enabled).
<p>Default: 20 </p>
<dt><strong>idle_session_timeout</strong>
<dd>The timeout, in seconds, which is the maximum time a remote client may spend between FTP commands. If the timeout triggers, the remote client is kicked off.
<p>Default: 300 </p>
<dt><strong>listen_port</strong>
<dd>If vsftpd is in standalone mode, this is the port it will listen on for incoming FTP connections.
<p>Default: 21 </p>
<dt><strong>local_max_rate</strong>
<dd>The maximum data transfer rate permitted, in bytes per second, for local authenticated users.
<p>Default: 0 (unlimited) </p>
<dt><strong>local_umask</strong>
<dd>The value that the umask for file creation is set to for local users. NOTE! If you want to specify octal values, remember the "0" prefix otherwise the value will be treated as a base 10 integer!
<p>Default: 077 </p>
<dt><strong>max_clients</strong>
<dd>If vsftpd is in standalone mode, this is the maximum number of clients which may be connected. Any additional clients connecting will get an error message.
<p>Default: 0 (unlimited) </p>
<dt><strong>max_per_ip</strong>
<dd>If vsftpd is in standalone mode, this is the maximum number of clients which may be connected from the same source internet address. A client will get an error message if they go over this limit.
<p>Default: 0 (unlimited) </p>
<dt><strong>pasv_max_port</strong>
<dd>The maximum port to allocate for PASV style data connections. Can be used to specify a narrow port range to assist firewalling.
<p>Default: 0 (use any port) </p>
<dt><strong>pasv_min_port</strong>
<dd>The minimum port to allocate for PASV style data connections. Can be used to specify a narrow port range to assist firewalling.
<p>Default: 0 (use any port) </p>
<dt><strong>trans_chunk_size</strong>
<dd>You probably don't want to change this, but try setting it to something like 8192 for a much smoother bandwidth limiter.
<p>Default: 0 (let vsftpd pick a sensible setting)
<p>&#160;</p>
</dd></dl><a name=lbAG>&nbsp;</a>
<h2>STRING OPTIONS</h2>
Below is a list of string options.
<p>
<dl compact>
<dt><strong>anon_root</strong>
<dd>This option represents a directory which vsftpd will try to change into after an anonymous login. Failure is silently ignored.
<p>Default: (none) </p>
<dt><strong>banned_email_file</strong>
<dd>This option is the name of a file containing a list of anonymous e-mail passwords which are not permitted. This file is consulted if the option <strong>deny_email_enable</strong> is enabled.
<p>Default: /etc/vsftpd.banned_emails </p>
<dt><strong>banner_file</strong>
<dd>This option is the name of a file containing text to display when someone connects to the server. If set, it overrides the banner string provided by the <strong>ftpd_banner</strong> option.
<p>Default: (none) </p>
<dt><strong>chown_username</strong>
<dd>This is the name of the user who is given ownership of anonymously uploaded files. This option is only relevant if another option, <strong>chown_uploads</strong>, is set.
<p>Default: root </p>
<dt><strong>chroot_list_file</strong>
<dd>The option is the name of a file containing a list of local users which will be placed in a chroot() jail in their home directory. This option is only relevant if the option <strong>chroot_list_enable</strong> is enabled. If the option <strong>chroot_local_user</strong> is enabled, then the list file becomes a list of users to NOT place in a chroot() jail.
<p>Default: /etc/vsftpd.chroot_list </p>
<dt><strong>cmds_allowed</strong>
<dd>This options specifies a comma separated list of allowed FTP commands (post login. USER, PASS and QUIT are always allowed pre-login). Other commands are rejected. This is a powerful method of really locking down an FTP server. Example: cmds_allowed=PASV,RETR,QUIT
<p>Default: (none) </p>
<dt><strong>deny_file</strong>
<dd>This option can be used to set a pattern for filenames (and directory names etc.) which should not be accessible in any way. The affected items are not hidden, but any attempt to do anything to them (download, change into directory, affect something within directory etc.) will be denied. This option is very simple, and should not be used for serious access control - the filesystem's permissions should be used in preference. However, this option may be useful in certain virtual user setups. In particular aware that if a filename is accessible by a variety of names (perhaps due to symbolic links or hard links), then care must be taken to deny access to all the names. Access will be denied to items if their name contains the string given by hide_file, or if they match the regular expression specified by hide_file. Note that vsftpd's regular expression matching code is a simple implementation which is a subset of full regular expression functionality. Because of this, you will need to carefully and exhaustively test any application of this option. And you are recommended to use filesystem permissions for any important security policies due to their greater reliability. Example: deny_file={*.mp3,*.mov,.private}
<p>Default: (none) </p>
<dt><strong>dsa_cert_file</strong>
<dd>This option specifies the location of the DSA certificate to use for SSL encrypted connections.
<p>Default: (none - an RSA certificate suffices) </p>
<dt><strong>email_password_file</strong>
<dd>This option can be used to provide an alternate file for usage by the <strong>secure_email_list_enable</strong> setting.
<p>Default: /etc/vsftpd.email_passwords </p>
<dt><strong>ftp_username</strong>
<dd>This is the name of the user we use for handling anonymous FTP. The home directory of this user is the root of the anonymous FTP area.
<p>Default: ftp </p>
<dt><strong>ftpd_banner</strong>
<dd>This string option allows you to override the greeting banner displayed by vsftpd when a connection first comes in.
<p>Default: (none - default vsftpd banner is displayed) </p>
<dt><strong>guest_username</strong>
<dd>See the boolean setting <strong>guest_enable</strong> for a description of what constitutes a guest login. This setting is the real username which guest users are mapped to.
<p>Default: ftp </p>
<dt><strong>hide_file</strong>
<dd>This option can be used to set a pattern for filenames (and directory names etc.) which should be hidden from directory listings. Despite being hidden, the files / directories etc. are fully accessible to clients who know what names to actually use. Items will be hidden if their names contain the string given by hide_file, or if they match the regular expression specified by hide_file. Note that vsftpd's regular expression matching code is a simple implementation which is a subset of full regular expression functionality. Example: hide_file={*.mp3,.hidden,hide*,h?}
<p>Default: (none) </p>
<dt><strong>listen_address</strong>
<dd>If vsftpd is in standalone mode, the default listen address (of all local interfaces) may be overridden by this setting. Provide a numeric IP address.
<p>Default: (none) </p>
<dt><strong>listen_address6</strong>
<dd>Like listen_address, but specifies a default listen address for the IPv6 listener (which is used if listen_ipv6 is set). Format is standard IPv6 address format.
<p>Default: (none) </p>
<dt><strong>local_root</strong>
<dd>This option represents a directory which vsftpd will try to change into after a local (i.e. non-anonymous) login. Failure is silently ignored.
<p>Default: (none) </p>
<dt><strong>message_file</strong>
<dd>This option is the name of the file we look for when a new directory is entered. The contents are displayed to the remote user. This option is only relevant if the option <strong>dirmessage_enable</strong> is enabled.
<p>Default: .message </p>
<dt><strong>nopriv_user</strong>
<dd>This is the name of the user that is used by vsftpd when it wants to be totally unprivileged. Note that this should be a dedicated user, rather than nobody. The user nobody tends to be used for rather a lot of important things on most machines.
<p>Default: nobody </p>
<dt><strong>pam_service_name</strong>
<dd>This string is the name of the PAM service vsftpd will use.
<p>Default: ftp </p>
<dt><strong>pasv_address</strong>
<dd>Use this option to override the IP address that vsftpd will advertise in response to the PASV command. Provide a numeric IP address.
<p>Default: (none - the address is taken from the incoming connected socket) </p>
<dt><strong>rsa_cert_file</strong>
<dd>This option specifies the location of the RSA certificate to use for SSL encrypted connections.
<p>Default: /usr/share/ssl/certs/vsftpd.pem </p>
<dt><strong>secure_chroot_dir</strong>
<dd>This option should be the name of a directory which is empty. Also, the directory should not be writable by the ftp user. This directory is used as a secure chroot() jail at times vsftpd does not require filesystem access.
<p>Default: /usr/share/empty </p>
<dt><strong>ssl_ciphers</strong>
<dd>This option can be used to select which SSL ciphers vsftpd will allow for encrpyted SSL connections. See the <strong>ciphers</strong> man page for further details. Note that restricting ciphers can be a useful security precaution as it prevents malicious remote parties forcing a cipher which they have found problems with.
<p>Default: DES-CBC3-SHA </p>
<dt><strong>user_config_dir</strong>
<dd>This powerful option allows the override of any config option specified in the manual page, on a per-user basis. Usage is simple, and is best illustrated with an example. If you set <strong>user_config_dir</strong> to be <strong>/etc/vsftpd_user_conf</strong> and then log on as the user "chris", then vsftpd will apply the settings in the file <strong>/etc/vsftpd_user_conf/chris</strong> for the duration of the session. The format of this file is as detailed in this manual page! PLEASE NOTE that not all settings are effective on a per-user basis. For example, many settings only prior to the user's session being started. Examples of settings which will not affect any behviour on a per-user basis include listen_address, banner_file, max_per_ip, max_clients, xferlog_file, etc.
<p>Default: (none) </p>
<dt><strong>user_sub_token</strong>
<dd>This option is useful is conjunction with virtual users. It is used to automatically generate a home directory for each virtual user, based on a template. For example, if the home directory of the real user specified via <strong>guest_username</strong> is <strong>/home/virtual/$USER</strong>, and <strong>user_sub_token</strong> is set to <strong>$USER</strong>, then when virtual user fred logs in, he will end up (usually chroot()'ed) in the directory <strong>/home/virtual/fred</strong>. This option also takes affect if <strong>local_root</strong> contains <strong>user_sub_token</strong>.
<p>Default: (none) </p>
<dt><strong>userlist_file</strong>
<dd>This option is the name of the file loaded when the <strong>userlist_enable</strong> option is active.
<p>Default: /etc/vsftpd.user_list </p>
<dt><strong>vsftpd_log_file</strong>
<dd>This option is the name of the file to which we write the vsftpd style log file. This log is only written if the option <strong>xferlog_enable</strong> is set, and <strong>xferlog_std_format</strong> is NOT set. Alternatively, it is written if you have set the option <strong>dual_log_enable</strong>. One further complication - if you have set <strong>syslog_enable</strong>, then this file is not written and output is sent to the system log instead.
<p>Default: /var/log/vsftpd.log </p>
<dt><strong>xferlog_file</strong>
<dd>This option is the name of the file to which we write the wu-ftpd style transfer log. The transfer log is only written if the option <strong>xferlog_enable</strong> is set, along with <strong>xferlog_std_format</strong>. Alternatively, it is written if you have set the option <strong>dual_log_enable</strong>.
<p>Default: /var/log/xferlog
<p>&#160;</p>
</dd></dl><a name=lbAH>&nbsp;</a> 
<img src ="http://www.cnitblog.com/snfnvtk/aggbug/45451.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/snfnvtk/" target="_blank">network</a> 2008-06-11 21:09 <a href="http://www.cnitblog.com/snfnvtk/archive/2008/06/11/45451.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>openssl+apache</title><link>http://www.cnitblog.com/snfnvtk/archive/2008/06/06/45047.html</link><dc:creator>network</dc:creator><author>network</author><pubDate>Thu, 05 Jun 2008 16:50:00 GMT</pubDate><guid>http://www.cnitblog.com/snfnvtk/archive/2008/06/06/45047.html</guid><wfw:comment>http://www.cnitblog.com/snfnvtk/comments/45047.html</wfw:comment><comments>http://www.cnitblog.com/snfnvtk/archive/2008/06/06/45047.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/snfnvtk/comments/commentRss/45047.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/snfnvtk/services/trackbacks/45047.html</trackback:ping><description><![CDATA[<a href="http://www.7880.com/Info/Article-62f7b180.html">http://www.7880.com/Info/Article-62f7b180.html</a>&nbsp; <br>先安装openssl<br><br>&nbsp;rpm -qa openssl<br><br>rpm &#8211;e &#8211;-nodeps openssl<br><br>tar xvzf&nbsp; openssl***.tar.gz<br><br>cd openssl***<br><br>./config --prefix=/usr/local/openssl shared<br><br><br>make <br><br>make test<br><br>make install<br><br><br>安装apache<br><br>tar xvzf apache***.tar.gz<br><br>cd apache***<br><br>./configure --prefix=/usr/local/apache --enable-rewrite --enable-so --enable-ssl&nbsp; with-ssl=/usr/local/openssl<br><br>make <br><br>make install<br><br><span class=postbody>安装openssl后，在openssl下有一个CA.sh文件，就是利用此文件来签证， <br>来签三张证书，然后利用这三张证书来布SSL服务器。 <br><br>1、在/usr/local/apache/conf下，建立一个ssl.crt目录，将CA.sh文件copy至/usr/local/apache/conf/ssl.crt/目录 <br>
<table cellSpacing=1 cellPadding=3 width="90%" align=center border=0>
    <tbody>
        <tr>
            <td><span class=genmed>代码:</span></td>
        </tr>
        <tr>
            <td class=code>[root@win ssl]# cp /usr/local/openssl/ssl/misc/CA.sh /usr/local/apache/conf/ssl.crt/CA.sh</td>
        </tr>
    </tbody>
</table>
<span class=postbody><br><br>2、运行CA.sh -newca，他会找你要CA需要的一个CA自己的私有密钥密码文件。如果没有这个文件？按回车会自动创建，输入密码来保护这个密码文件。之后会要你的一个公司信息来做CA.crt文件。最后在当前目录下多了一个./demoCA这样的目录../demoCA/private/cakey.pem就是CA的key文件啦，./demoCA/cacert.pem就是CA的crt文件了 <br></span>
<table cellSpacing=1 cellPadding=3 width="90%" align=center border=0>
    <tbody>
        <tr>
            <td><span class=genmed>代码:</span></td>
        </tr>
        <tr>
            <td class=code>[root@win ssl.crt]# ./CA.sh -newca</td>
        </tr>
    </tbody>
</table>
<span class=postbody><br><br>要求输入如下信息： <br></span>
<table cellSpacing=1 cellPadding=3 width="90%" align=center border=0>
    <tbody>
        <tr>
            <td><span class=genmed>引用:</span></td>
        </tr>
        <tr>
            <td class=quote>Country Name (2 letter code) [GB]:CN <br>State or Province Name (full name) [Berkshire]:FUJIAN <br>Locality Name (eg, city) [Newbury]:FUZHOU <br>Organization Name (eg, company) [My Company Ltd]:FJJM <br>Organizational Unit Name (eg, section) []:FD <br>Common Name (eg, your name or your server's hostname) []:WIN <br>Email Address []:WIN@WIN.COM</td>
        </tr>
    </tbody>
</table>
<span class=postbody><br>这样就建好了一个CA服务器，有了一个根证书的私钥cakey.pem及一张根证书cacert.pem,现在就可以cacert.pem来给签证了 <br><br>3、签署服务器证书 <br>生成服务器私钥： <br></span>
<table cellSpacing=1 cellPadding=3 width="90%" align=center border=0>
    <tbody>
        <tr>
            <td><span class=genmed>代码:</span></td>
        </tr>
        <tr>
            <td class=code>[root@win ssl.crt]# openssl genrsa -des3 -out server.key 1024</td>
        </tr>
    </tbody>
</table>
<span class=postbody><br>生成服务器证书请求 <br></span>
<table cellSpacing=1 cellPadding=3 width="90%" align=center border=0>
    <tbody>
        <tr>
            <td><span class=genmed>代码:</span></td>
        </tr>
        <tr>
            <td class=code>[root@win ssl.crt]# openssl req -new -key server.key -out server.csr</td>
        </tr>
    </tbody>
</table>
<span class=postbody><br>会要求输入信息 <br></span>
<table cellSpacing=1 cellPadding=3 width="90%" align=center border=0>
    <tbody>
        <tr>
            <td><span class=genmed>代码:</span></td>
        </tr>
        <tr>
            <td class=code>Country Name (2 letter code) [GB]:CN <br>State or Province Name (full name) [Berkshire]:FUJIAN <br>Locality Name (eg, city) [Newbury]:FUZHOU <br>Organization Name (eg, company) [My Company Ltd]:FJJM <br>Organizational Unit Name (eg, section) []:FD <br>Common Name (eg, your name or your server's hostname) []:WIN <br>Email Address []:WIN@WIN.COM <br>Please enter the following 'extra' attributes <br>to be sent with your certificate request <br>A challenge password []:WIN <br>An optional company name []:WING</td>
        </tr>
    </tbody>
</table>
<span class=postbody><br><br>最后把server.crt文件mv成newreq.pem,然后用CA.sh来签证就可以了 <br></span>
<table cellSpacing=1 cellPadding=3 width="90%" align=center border=0>
    <tbody>
        <tr>
            <td><span class=genmed>代码:</span></td>
        </tr>
        <tr>
            <td class=code>[root@win ssl.crt]# mv server.csr newreq.pem <br>[root@win ssl.crt]# ./CA.sh -sign</td>
        </tr>
    </tbody>
</table>
<span class=postbody>这样就生成了server的证书newcert.pem <br>把newcert.pem改名成server.crt <br></span>
<table cellSpacing=1 cellPadding=3 width="90%" align=center border=0>
    <tbody>
        <tr>
            <td><span class=genmed>代码:</span></td>
        </tr>
        <tr>
            <td class=code>[root@win ssl.crt]# mv newcert.pem server.crt</td>
        </tr>
    </tbody>
</table>
<span class=postbody><br><br><br>4、处理客户端： <br>生成客户私钥： <br></span>
<table cellSpacing=1 cellPadding=3 width="90%" align=center border=0>
    <tbody>
        <tr>
            <td><span class=genmed>代码:</span></td>
        </tr>
        <tr>
            <td class=code>[root@win ssl.crt]# openssl genrsa -des3 -out client.key 1024</td>
        </tr>
    </tbody>
</table>
<span class=postbody><br>请求 <br></span>
<table cellSpacing=1 cellPadding=3 width="90%" align=center border=0>
    <tbody>
        <tr>
            <td><span class=genmed>代码:</span></td>
        </tr>
        <tr>
            <td class=code>[root@win ssl.crt]# openssl req -new -key client.key -out client.csr</td>
        </tr>
    </tbody>
</table>
<span class=postbody><br>签证： <br></span>
<table cellSpacing=1 cellPadding=3 width="90%" align=center border=0>
    <tbody>
        <tr>
            <td><span class=genmed>代码:</span></td>
        </tr>
        <tr>
            <td class=code>[root@win ssl.crt]# openssl ca -in client.csr -out client.crt</td>
        </tr>
    </tbody>
</table>
<span class=postbody><br>把证书格式转换成pkcs12格式 <br></span>
<table cellSpacing=1 cellPadding=3 width="90%" align=center border=0>
    <tbody>
        <tr>
            <td><span class=genmed>代码:</span></td>
        </tr>
        <tr>
            <td class=code>[root@win ssl.crt]# openssl pkcs12 -export -clcerts -in client.crt -inkey client.key -out client.pfx</td>
        </tr>
    </tbody>
</table>
<span class=postbody><br><br>5、这时就有了三张证书和三个私钥，一个是demoCA下的根证书,ssl.crt下的服务器证书和客户证书。及demoCA/private下的根key,ssl.crt下的服务器key和客户key,在conf下的ssl.conf下指定证书的位置和服务器key的位置. <br><br>我是在conf下建立一个ssl.crt目录，并将所有的key和证书放到这里 <br></span>
<table cellSpacing=1 cellPadding=3 width="90%" align=center border=0>
    <tbody>
        <tr>
            <td><span class=genmed>代码:</span></td>
        </tr>
        <tr>
            <td class=code>#cp demoCA/cacert.pem cacert.pem</td>
        </tr>
    </tbody>
</table>
<span class=postbody><br>同时复制一份证书，更名为ca.crt <br></span>
<table cellSpacing=1 cellPadding=3 width="90%" align=center border=0>
    <tbody>
        <tr>
            <td><span class=genmed>代码:</span></td>
        </tr>
        <tr>
            <td class=code>#cp cacert.pem ca.crt</td>
        </tr>
    </tbody>
</table>
<span class=postbody><br><br><br><br>、编辑ssl.conf <br></span>
<table cellSpacing=1 cellPadding=3 width="90%" align=center border=0>
    <tbody>
        <tr>
            <td><span class=genmed>代码:</span></td>
        </tr>
        <tr>
            <td class=code>#cd /usr/local/apache/conf</td>
        </tr>
    </tbody>
</table>
<span class=postbody><br>编辑ssl.conf <br></span>
<table cellSpacing=1 cellPadding=3 width="90%" align=center border=0>
    <tbody>
        <tr>
            <td><span class=genmed>代码:</span></td>
        </tr>
        <tr>
            <td class=code>指定服务器证书位置 <br>SSLCertificateFile /usr/local/apache/conf/ssl.crt/server.crt <br>指定服务器证书key位置 <br>SSLCertificateKeyFile /usr/local/apache/conf/ssl.crt/server.key <br>证书目录 <br>SSLCACertificatePath /usr/local/apache/conf/ssl.crt <br>根证书位置 <br>SSLCACertificateFile /usr/local/apache/conf/ssl.crt/cacert.pem <br>开启客户端SSL请求 <br>SSLVerifyClient require <br>SSLVerifyDepth&nbsp; 1</td>
        </tr>
    </tbody>
</table>
<span class=postbody><br><br>启动ssl <br></span>
<table cellSpacing=1 cellPadding=3 width="90%" align=center border=0>
    <tbody>
        <tr>
            <td><span class=genmed>代码:</span></td>
        </tr>
        <tr>
            <td class=code>/usr/local/apache/bin/apachectl startssl</td>
        </tr>
    </tbody>
</table>
<span class=postbody>会要求输入server.key的密码 <br>启动，这样一个默认的SSL服务器及http服务器就启动了， <br><br><span style="FONT-WEIGHT: bold">安装和使用证书</span> <br>把刚才生成的证书：根证书ca.crt和客户证书client.pfx下到客户端，并安装， <br>ca.crt安装到信任的机构，client.pfx直接在windows安装或安装到个人证书位置，然后用IP访问HTTP和https服务器。</span><span class=postbody><br></span><br><br></span>
<img src ="http://www.cnitblog.com/snfnvtk/aggbug/45047.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/snfnvtk/" target="_blank">network</a> 2008-06-06 00:50 <a href="http://www.cnitblog.com/snfnvtk/archive/2008/06/06/45047.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于openssl 和openssh安装</title><link>http://www.cnitblog.com/snfnvtk/archive/2008/06/06/45046.html</link><dc:creator>network</dc:creator><author>network</author><pubDate>Thu, 05 Jun 2008 16:29:00 GMT</pubDate><guid>http://www.cnitblog.com/snfnvtk/archive/2008/06/06/45046.html</guid><wfw:comment>http://www.cnitblog.com/snfnvtk/comments/45046.html</wfw:comment><comments>http://www.cnitblog.com/snfnvtk/archive/2008/06/06/45046.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/snfnvtk/comments/commentRss/45046.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/snfnvtk/services/trackbacks/45046.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 首先安装好openssl&nbsp;<br><br>&nbsp;&nbsp; tar xvzf openssl***.tar.gz<br><br>&nbsp; cd openssl***<br><br>&nbsp;./config --prefix=/usr/local/openssl shared<br><br>&nbsp;make<br><br>&nbsp;make test<br><br>make install<br><br><br>安装好后.就更新系统动态连接库<br><br>&nbsp;echo /usr/local/openssl/lib &gt;&gt; /etc/ld.so.conf<br><br>&nbsp;ldconfig<br><br><br>这是再安装 openssh<br><br>在安装前请先删除系统原来的openssh<br><br>rpm -qa |grep openssh<br><br>rpm &#8211;e &#8211;-nodeps openssh<br><br><br>&nbsp;tar -xvzf openssh****.tar.gz<br><br>&nbsp;cd openssh****<br><br>&nbsp;./configure --prefix=/usr/local/openssh --with-ssl-dir=/usr/local/openssl<br><br><br>然后就可以启动sshd服务了<br><br>/usr/local/openssh/sbin/sshd -f /usr/local/openssh/etc/sshd_config<br><br><br>这时系统如果没有报错,就可以使用客户端进行边接..<br><br>如果在Linux/UNIX下，那么用OpenSSH带的ssh客户端就OK了，如果在Windows下，强烈建议采用SecureCRT<br><br><br>本文参考:<br><a href="http://bbs.netbuddy.org/unix/737.html">http://bbs.netbuddy.org/unix/737.html</a><br>&nbsp;&nbsp;<br>&nbsp;&nbsp;<br>&nbsp; 
<img src ="http://www.cnitblog.com/snfnvtk/aggbug/45046.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/snfnvtk/" target="_blank">network</a> 2008-06-06 00:29 <a href="http://www.cnitblog.com/snfnvtk/archive/2008/06/06/45046.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>OpenSSL-0.9.8g 安装与配置指南</title><link>http://www.cnitblog.com/snfnvtk/archive/2008/06/05/45038.html</link><dc:creator>network</dc:creator><author>network</author><pubDate>Thu, 05 Jun 2008 14:06:00 GMT</pubDate><guid>http://www.cnitblog.com/snfnvtk/archive/2008/06/05/45038.html</guid><wfw:comment>http://www.cnitblog.com/snfnvtk/comments/45038.html</wfw:comment><comments>http://www.cnitblog.com/snfnvtk/archive/2008/06/05/45038.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/snfnvtk/comments/commentRss/45038.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/snfnvtk/services/trackbacks/45038.html</trackback:ping><description><![CDATA[<h1>OpenSSL-0.9.8g 安装与配置指南</h1>
<h2 id=auth_name>作者：<strong><a href="http://lamp.linux.gov.cn/jinbuguo_florilegium.html"><u><font color=#0000ff>金步国</font></u></a></strong></h2>
<u><font color=#0000ff>
<hr>
</font></u>
<h3>版权声明</h3>
<p>本文作者是一位自由软件爱好者，所以本文虽然不是软件，但是本着 GPL 的精神发布。任何人都可以自由使用、转载、复制和再分发，但必须保留作者署名，亦不得对声明中的任何条款作任何形式的修改，也不得附加任何其它条件。您可以自由链接、下载、传播此文档，但前提是必须保证全文完整转载，包括完整的版权信息和作译者声明。</p>
<h3>其他作品</h3>
<p>本文作者十分愿意与他人共享劳动成果，如果你对我的其他翻译作品或者技术文章有兴趣，可以在如下位置查看现有作品的列表：</p>
<ul>
    <li><a href="http://lamp.linux.gov.cn/jinbuguo_florilegium.html"><u><font color=#0000ff>金步国作品列表</font></u></a> </li>
</ul>
<h3>BUG报告，切磋与探讨</h3>
<p>由于作者水平有限，因此不能保证作品内容准确无误，请在阅读中自行鉴别。如果你发现了作品中的错误，请您来信指出，哪怕是错别字也好，任何提高作品质量的建议我都将虚心接纳。如果你愿意就作品中的相关内容与我进行进一步切磋与探讨，也欢迎你与我联系。联系方式：Email: csfrank@citiz.net ； QQ: 70171448 ； MSN: csfrank122@hotmail.com</p>
<hr>
<h2>系统需求</h2>
<p>OpenSSL可以在多种操作系统上安装，但是本文只讨论在Linux或BSD系统上的安装。</p>
<p>安装OpenSSL的系统需求很低，只要有 ANSI C 编译器(推荐GCC)、Perl 5 、make 即可。但是OpenSSL的测试程序依赖于<a href="http://ftp.gnu.org/gnu/bc/"><u><font color=#0000ff>GNU BC</font></u></a>，如果你需要运行测试程序的话，就要事先安装好它。</p>
<h2>编译选项</h2>
<p>将下载回来的压缩包解压，进入解压后的目录，即可使用 config 或 Configure 脚本进行配置。OpenSSL的配置脚本与大多数典型的软件包不同，它有自己的一套规则。详细的安装信息位于源码树下的 INSTALL Configure(特别是"PROCESS_ARGS"段) Makefile.shared Makefile.org 文件中。安装后的使用与配置信息位于 doc 目录中， FAQ 文件也可以提供一些参考。</p>
<p>config 脚本检查系统环境并调用 Configure 完成配置，因此配置选项是通过 config 脚本向 Configure 传递的。事实上 config 脚本的作用相当于 config.guess ，所以如果你想直接调用 Configure 的话就一定要正确指定"操作系统-目标平台"(笔者推荐这个用法)。所有可用的目标机器列表可以使用"./Configure LIST"命令获取。Configure 脚本除了根据 Makefile.org 生成 Makefile 之外，还在 crypto/opensslconf.h 中定义了许多宏(基于 crypto/opensslconf.h.in)。</p>
<p>在 config 或 Configure 命令行上可以使用许多选项，大体上可以分为3类。</p>
<h3>全局选项</h3>
<p>第一类是全局性选项：</p>
<dl>
<dt>--openssldir=OPENSSLDIR
<dd>安装目录，默认是 /usr/local/ssl 。
<dt>--prefix=PREFIX
<dd>设置 lib include bin 目录的前缀，默认为 OPENSSLDIR 目录。
<dt>--install_prefix=DESTDIR
<dd>设置安装时以此目录作为"根"目录，通常用于打包，默认为空。
<dt>zlib<br>zlib-dynamic<br>no-zlib
<dd>使用静态的zlib压缩库、使用动态的zlib压缩库、不使用zlib压缩功能。
<dt>threads<br>no-threads
<dd>是否编译支持多线程的库。默认支持。
<dt>shared<br>no-shared
<dd>是否生成动态连接库。
<dt>asm<br>no-asm
<dd>是否在编译过程中使用汇编代码加快编译过程。
<dt>enable-sse2<br>no-sse2
<dd>启用/禁用SSE2指令集加速。如果你的CPU支持SSE2指令集，就可以打开，否则就要关闭。
<dt>gmp<br>no-gmp
<dd>启用/禁用GMP库
<dt>rfc3779<br>no-rfc3779
<dd>启用/禁用实现X509v3证书的IP地址扩展
<dt>krb5<br>no-krb5
<dd>启用/禁用 Kerberos 5 支持
<dt>ssl<br>no-ssl<br>ssl2<br>ssl3<br>no-ssl2<br>no-ssl3<br>tls<br>no-tls
<dd>启用/禁用 SSL(包含了SSL2/SSL3) TLS 协议支持。
<dt>dso<br>no-dso
<dd>启用/禁用调用其它动态链接库的功能。[提示]no-dso仅在no-shared的前提下可用。 </dd></dl>
<p>[提示]为了安装Apache的mod_ssl成功，SSLv2/SSLv3/TLS都必须开启。</p>
<h3>算法选项</h3>
<p>第二类用于禁用crypto目录下相应的子目录(主要是各种算法)。虽然理论上这些子目录都可以通过"no-*"语法禁用，但是实际上，为了能够最小安装libcrypto,libssl,openssl，其中的大部分目录都必须保留，实际可选的目录仅有如下这些：</p>
<dl>
<dt>no-md2,no-md4,no-mdc2,no-ripemd
<dd>这些都是摘要算法，含义一目了然。
<dt>no-des,no-rc2,no-rc4,no-rc5,no-idea,no-bf,no-cast,no-camellia
<dd>这些都是对称加密算法，含义一目了然。"bf"是"Blowfish"的意思。
<dt>no-ec,no-dsa,no-ecdsa,no-dh,no-ecdh
<dd>这些都是不对称加密算法，含义一目了然。
<dt>no-comp
<dd>数据压缩算法。因为目前实际上并没有压缩算法，所以只是定义了一些空接口。
<dt>no-store
<dd>对象存储功能。更多细节可以查看 crypto/store/README 文件。 </dd></dl>
<p>[提示]OpenSSH 只依赖于该软件包的加密库(libcrypto)，而带有 HTTPS 支持的 Apache 则依赖于该软件包的加密库和 SSL/TLS 库(libssl)。因此，如果你不打算使用 HTTPS 的话，可以只安装加密库(no-ssl no-tls)；更多介绍可以查看 README 文件的"OVERVIEW"部分。事实上，为了能够让OpenSSH安装成功，ripemd,des,rc4,bf,cast,dsa,dh目录不能被禁止。</p>
<h3>编译器选项</h3>
<p>第三类是编译器选项。大多数软件包都是通过在运行 configure 脚本的时候定义 CPPFLAGS CFLAGS LDFLAGS 环境变量来设置编译选项的，但是OpenSSL却不是这样。OpenSSL的 Configure 脚本允许你在命令行上直接输入 CPPFLAGS CFLAGS 的内容。比如：-DDEVRANDOM='"/dev/urandom"' 可以用来指定随机设备， -DSSL_FORBID_ENULL 则可以用于禁止使用NULL加密算法。`echo $CFLAGS` 则可以将 CFLAGS 变量添加上来。另一方面，LDFLAGS却是无法通过Configure进行设置的。因为Configure会强制清空Makefile中的LDFLAGS，所以在运行完Configure之后，可以使用一个sed修改所有Makefile中的 LDFLAGS(用于连接openssl)和SHARED_LDFLAGS(用于连接libcrypto,libssl库)。</p>
<p>比如笔者就经常这样使用 Configure 进行配置：</p>
<pre>./Configure ... -DSSL_FORBID_ENULL -DDEVRANDOM='"/dev/urandom"' `echo $CFLAGS`
find . -name "Makefile*" -exec sed -r -i -e"s|^(SHARED_)?LDFLAGS=|&amp; $LDFLAGS |" {} \;
</pre>
<p>[提示]不能省略find命令内"Makefile*"两边的引号。</p>
<h2>编译、测试、安装</h2>
<p>配置完毕后，需要使用 make depend 重新建立依赖关系，特别是你使用了"no-*"选项之后，否则编译可能会失败。</p>
<p>然后使用 make 命令编译。如果编译成功，那么最好使用 make test 进行一下测试。</p>
<p>如果测试也通过了，那么接下来就是安装了。安装很简单，一条 make install 命令即可。你还可以使用 make install INSTALL_PREFIX=/other/dir 来将 /other/dir 当作"根"进行安装，这通常用于打包。</p>
<h2>配置文件</h2>
<p>安装完毕之后，接下来就是配置。OpenSSL的配置文件是 openssl.cnf ，位于 --openssldir 指定的目录下。</p>
<p>在实践中，OpenSSL 的一个重要用途就是证书签发和管理，这需要配置文件的配合。如果你只是使用它的加密库，而不使用证书功能的话，就不需要了解如何配置OpenSSL 。</p>
<p>下面是一个简单的 openssl.cnf 文件，已经可以用于证书签发了。当然，这份配置用来自己玩玩还行，指望用这个去做真正的"Big Brother"，没人会信你 :)</p>
<pre>########################
# OpenSSL 配置文件示范 #
########################
# [注意]这个示范文件并不是默认设置。
########
# 语法 #
########
#
# 变量 = 值
#
# 语法很简单，一看就懂，但是有几点需要说明：
# 1. 字符串值最好使用双引号界定，并且其中可以使用"\n","\r","\t"这些转义序列("\"怎么表示?)。
# 2. 可以使用 ${变量名} 的形式引用同一字段中的变量，使用 ${字段名::变量名} 的形式引用其它字段中的变量。
# 3. 可以使用 ${EVP::环境变量} 的形式引用操作系统中定义的环境变量，若变量不存在则会导致错误。
# 4. 可以在默认字段定义与操作系统环境变量同名的变量作为默认值来避免环境变量不存在导致的错误。
# 5. 如果在同一字段内有多个相同名称的变量，那么后面的值将覆盖前面的值。
#
############
# 默认字段 #
############
# 此部分是默认字段[配置段]，必须放在所有字段之前。
# 读取配置文件数据时，会首先根据字段名称去寻找相应的配置段，如果没有找到则会使用这里的默认字段。
# 定义 HOME 的默认值，防止操作系统中不存在 HOME 环境变量。
HOME = .
# 默认的随机数种子文件，建议设置为 /dev/random 或 /dev/urandom
RANDFILE = $ENV::HOME/.rnd
# 扩展对象定义
# 比如，OpenSSL中并未定义X.509证书的扩展项，在使用到的时候就会从下面对扩展对象的定义中获取。
# 定义的方法有两种，第一种(反对使用)是存储在外部文件中，也就是这里"oid_file"变量定义的文件。
#oid_file = $ENV::HOME/.oid
# 第二种是存储在配置文件的一个字段中，也就是这里"oid_section"变量值所指定的字段。
oid_section = new_oids
[ new_oids ]
# 可以在这里添加扩展对象的定义，例如可以被'ca'和'req'使用。
# 格式如下：
# 对象简称 = 对象数字ID
############################################################################################################
####################
##  证书请求配置  ##
####################
# 在申请证书之前通常需要首先生成符合 PKCS#10 标准的证书请求封装格式。
# openssl 的 req 指令实现了产生证书请求的功能，其相关选项的默认值就来自于这里的设置。
# 证书请求的配置分成几个字段，包括一个基本字段和几个附属字段。
##### 证书请求配置的"基本字段"，其它附属字段都以它为入口 #####
[ req ]
# 生成的证书中RSA密钥对的默认长度，取值是2的整数次方。建议使用4096以上。
default_bits = 1024
# 保存生成的私钥文件的默认文件名
default_keyfile = privkey.pem
# 生成的私钥文件是否采用口令加密保护，可以设为yes或no。
encrypt_key = yes
# 读取输入私钥文件时的口令，如果未设置那么将会提示输入。
# input_password = secret
# 保存输出私钥文件时的口令，如果未设置那么将会提示输入。
# output_password = secret
# 签名默认使用的信息摘要算法，可以使用：md5,sha1,mdc2,md2
default_md = md5
# 为一些字段设置默认的字符串类型，比如证书请求中的城市和组织名称。可能的取值和解释如下：
# default: 包含了 PrintableString, T61String, BMPString 三种类型
# pkix  : 包含了 PrintableString, BMPString 两种类型
# utf8only: 只使用 UTF8 字符串。推荐使用这个，这样可以完美的包含任意字符。
# nombstr : 包含了 PrintableString, T61String 两种类型(不使用 BMPStrings 或 UTF8String 两种多字节字符类型)
string_mask = nombstr
# 如果设为yes，那么不管是命令行还是配置文件中的字符串都将按照UTF-8编码看待。默认值no表示仅使用ASCII编码。
utf8 = no
# 如果设为no，那么 req 指令将直接从配置文件中读取证书字段的信息，而不提示用户输入。
prompt = yes
# 定义输入用户信息选项的"特征名称"字段名，该扩展字段定义了多项用户信息。
distinguished_name = req_distinguished_name
# 定义证书请求属性的字段名，该扩展字段定义了证书请求的一些属性，但openssl的证书签发工具并不使用它们。
attributes = req_attributes
# 证书请求扩展的字段名，该扩展字段定义了要加入到证书请求中的一系列扩展项。
# req_extensions = v3_req
# 生成自签名证书时要使用的证书扩展项字段名，该扩展字段定义了要加入到证书中的一系列扩展项。
x509_extensions = v3_ca
##### "特征名称"字段包含了用户的标识信息 #####
[ req_distinguished_name ]
countryName = CN  #只能使用2字母的国家代码
stateOrProvinceName = BeiJin
organizationName = 组织名
commonName = 公司名
##### 证书请求属性字段定义了证书请求的一些属性(都不是必须的) #####
[ req_attributes ]
##### 要加入到证书请求中的一系列扩展项 #####
[ v3_req ]
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
#### 生成自签名证书时使用的证书扩展项 #####
### 因为这部分是非必须的，所以不翻译了，事实上你完全可以删除这部分内容
[ v3_ca ]
# PKIX recommendation.
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer:always
# This is what PKIX recommends but some broken software chokes on critical
# extensions.
#basicConstraints = critical,CA:true
# So we do this instead.
basicConstraints = CA:true
# Key usage: this is typical for a CA certificate. However since it will
# prevent it being used as an test self-signed certificate it is best
# left out by default.
# keyUsage = cRLSign, keyCertSign
# Some might want this also
# nsCertType = sslCA, emailCA
# Include email address in subject alt name: another PKIX recommendation
# subjectAltName = email:copy
# Copy issuer details
# issuerAltName = issuer:copy
# DER hex encoding of an extension: beware experts only!
# obj=DER:02:03
# Where 'obj' is a standard or added object
# You can even override a supported extension:
# basicConstraints = critical, DER:30:03:01:01:FF
############################################################################################################
####################
##  证书签发配置  ##
####################
# openssl 的 ca 指令实现了证书签发的功能，其相关选项的默认值就来自于这里的设置。
# 这个字段只是通过唯一的default_ca变量来指定默认的CA主配置字段的入口(-name 命令行选项的默认值)
[ ca ]
default_ca = CA_default
##### 默认的CA主配置字段 #####
[ CA_default ]
# 保存所有信息的文件夹，这个变量只是为了给后面的变量使用
dir = ./demoCA
# 存放CA本身根证书的文件名
certificate = $dir/cacert.pem
# 存放CA自身私钥的文件名
private_key = $dir/private/cakey.pem
# 签发证书时使用的序列号文本文件，里面必须包含下一个可用的16进制数字。
serial = $dir/serial
# 存放新签发证书的默认目录，证书名就是该证书的系列号，后缀是.pem
new_certs_dir = $dir/newcerts
# 已生成的证书的默认保存目录
certs = $dir/certs
# 保存已签发证书的文本数据库文件，初始时为空。
database = $dir/index.txt
# 存放当前CRL编号的文件，对于v1版本的CRL则必须注释掉该行
crlnumber = $dir/crlnumber
# 当前CRL文件
crl = $dir/crl.pem
# 生成的证书撤销列表(CRL)的默认保存目录
crl_dir = $dir/crl
# 同一个subject是否只能创建一个证书，设为no表示可以创建多个
unique_subject = yes
# 签发新证书以及CRL时默认的摘要算法，可以使用：md5,md2,mdc2,sha1
default_md = sha1
# 通常，证书签发的特种名称(DN)域的各个参数顺序与证书策略的参数顺序一致。
# 但是，如果这里设为yes则保持与证书请求中的参数顺序一致。
preserve = no
# 当用户需要确认签发证书时显示可读证书DN域的方式。可用值与 x509 指令的 -nameopt 选项相同。
name_opt = ca_default
# 当用户需要确认签发证书时显示证书域的方式。
# 可用值与 x509 指令的 -certopt 选项相同，不过 no_signame 和 no_sigdump 总被默认设置。
cert_opt  = ca_default
# 新证书默认的生效日期，如果未设置则使用签发时的时间，格式为：YYMMDDHHNNSSZ(年月日时分秒Z)
# default_startdate = 080303223344Z
# 新证书默认的失效日期，格式为：YYMMDDHHNNSSZ(年月日时分秒Z)
# default_enddate = 090303223344Z
# 新签发的证书默认有效期，以天为单位
default_days = 365
# 从当前CRL(证书撤销列表)到下次CRL发布的间隔天数
default_crl_days = 30
# 是否将证书请求中的扩展项信息加入到证书扩展项中去。取值范围以及解释：
# none: 忽略所有证书请求中的扩展项
# copy: 将证书扩展项中没有的项目复制到证书中
# copyall: 将所有证书请求中的扩展项都复制过去，并且覆盖证书扩展项中原来已经存在的值。
copy_extensions = none
# 定义用于证书请求DN域匹配策略的字段，用于决定CA要求和处理证书请求提供的DN域的各个参数值的规则。
policy  = policy_match
# 定义X.509证书扩展项的字段。如果没有提供这个字段则生成X.509v1而不是v3格式的证书。
x509_extensions = usr_cert
# 定义生成CRL时需要加入的扩展项字段。如果没有定义则生成v1而不是v2版本的CRL。
# crl_extensions = crl_ext
##### 证书请求信息的匹配策略 #####
# 变量名称是DN域对象的名称，变量值可以是：
# match: 该变量在证书请求中的值必须与CA证书相应的变量值完全相同，否则拒签。
# supplied: 该变量在证书请求中必须提供(值可以不同)，否则拒签。
# optional: 该变量在证书请求中可以存在也可以不存在(相当于没有要求)。
# 除非preserve=yes或者在ca命令中使用了-preserveDN，否则在签发证书时将删除匹配策略中未提及的对象。
[ policy_match ]
countryName  = match
stateOrProvinceName = match
organizationName = match
commonName  = supplied
organizationalUnitName = optional
emailAddress  = optional
### 下面的部分由于都是非必须的部分，因此也不翻译了。
### 事实上你完全可以从配置文件中删除这些内容
[ usr_cert ]
# These extensions are added when 'ca' signs a request.
# This goes against PKIX guidelines but some CAs do it and some software
# requires this to avoid interpreting an end user certificate as a CA.
basicConstraints=CA:FALSE
# Here are some examples of the usage of nsCertType. If it is omitted
# the certificate can be used for anything *except* object signing.
# This is OK for an SSL server.
# nsCertType   = server
# For an object signing certificate this would be used.
# nsCertType = objsign
# For normal client use this is typical
# nsCertType = client, email
# and for everything including object signing:
# nsCertType = client, email, objsign
# This is typical in keyUsage for a client certificate.
# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
# This will be displayed in Netscape's comment listbox.
nsComment   = "OpenSSL Generated Certificate"
# PKIX recommendations harmless if included in all certificates.
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid,issuer
# This stuff is for subjectAltName and issuerAltname.
# Import the email address.
# subjectAltName=email:copy
# An alternative to produce certificates that aren't
# deprecated according to PKIX.
# subjectAltName=email:move
# Copy subject details
# issuerAltName=issuer:copy
#nsCaRevocationUrl  = http://www.domain.dom/ca-crl.pem
#nsBaseUrl
#nsRevocationUrl
#nsRenewalUrl
#nsCaPolicyUrl
#nsSslServerName
[ crl_ext ]
# CRL extensions.
# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
# issuerAltName=issuer:copy
authorityKeyIdentifier=keyid:always,issuer:always
[ proxy_cert_ext ]
# These extensions should be added when creating a proxy certificate
# This goes against PKIX guidelines but some CAs do it and some software
# requires this to avoid interpreting an end user certificate as a CA.
basicConstraints=CA:FALSE
# Here are some examples of the usage of nsCertType. If it is omitted
# the certificate can be used for anything *except* object signing.
# This is OK for an SSL server.
# nsCertType   = server
# For an object signing certificate this would be used.
# nsCertType = objsign
# For normal client use this is typical
# nsCertType = client, email
# and for everything including object signing:
# nsCertType = client, email, objsign
# This is typical in keyUsage for a client certificate.
# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
# This will be displayed in Netscape's comment listbox.
nsComment   = "OpenSSL Generated Certificate"
# PKIX recommendations harmless if included in all certificates.
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid,issuer:always
# This stuff is for subjectAltName and issuerAltname.
# Import the email address.
# subjectAltName=email:copy
# An alternative to produce certificates that aren't
# deprecated according to PKIX.
# subjectAltName=email:move
# Copy subject details
# issuerAltName=issuer:copy
#nsCaRevocationUrl  = http://www.domain.dom/ca-crl.pem
#nsBaseUrl
#nsRevocationUrl
#nsRenewalUrl
#nsCaPolicyUrl
#nsSslServerName
# This really needs to be in place for it to be a proxy certificate.
proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
</pre>
<img src ="http://www.cnitblog.com/snfnvtk/aggbug/45038.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/snfnvtk/" target="_blank">network</a> 2008-06-05 22:06 <a href="http://www.cnitblog.com/snfnvtk/archive/2008/06/05/45038.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>