⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 1685.html

📁 著名的linux英雄站点的文档打包
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<br>
而hosts.deny为:all : all.这两个文件的意思是对telnet来讲,只允许来自secu.unix.org的连接,对ftp而言,允许10.68.32这个c类地址的连接.in.rshd这一部分语法稍微复杂一些,它的意思是外界任何一个ip每次试图使用rsh连接本系统的时候系统会finger发起连接请求的远程用户,并立即将结果发mail到一个管理员的远程信箱yiming@371.net,我们知道,管理员之所以这么做,是因为一般试图进行rsh的连接, 都是有很大的潜在危险性的,这说明也许系统已经被人入侵,并安插了.rhosts文件了,这很危险! 所以对管理员来说,这种连接需要引起极大的注意. hosts.deny文件中的all : all表示除了这些以外,拒绝来自任何地方的任何服务.以上只是对访问控制文件的一个简单说明,管理员可以参看Tcp_wrapper的相应说明定制更为复杂的控制策略.同时需要说明的是,如果需要象上例中设置对rsh的这种finger,mail功能,是需要在Makefile中打开language extension的.<br>
<br>
下面来讲讲Tcp_wrapper的安装<br>
<br>
首先,我们从可信站点下载tcp_wrappers,如ftp://ftp.porcupine。org/pub/security/tcp_wrappers_7.6.tar.gz(目前最新的版本是7.6)<br>
<br>
我们假设你的主机已有了各种所需的编译工具,cc(或gcc),make(或gmake),gzip等,如果使用solaris的读者主机上没有这些工具,可到sunfreeware.com下载它们,使用其它Unix系统亦可到相关站点下载。我们在得到Tcp_wrapper包后,用gzip和tar将压缩包解开,会生成Tcp_wrapper目录,进入目录,我们需要编辑Makefile文件,使它合乎我们的工作要求。编辑的基本工作可以分为3步。<br>
<br>
1:在Makefile的头一部分我们可以看到REAL_DAEMON_DIR的描述,它表明了Unix系统中真正的守护程序所在位置,即上面提到的第六个分隔段的守护进程所在目录,solaris中这些守护程序的目录是/usr/sbin,所以我们将SysV.4 Solaris 2.x OSF AIX前的#注释号去掉,即下面的形式:<br>
<br>
# Ultrix 4.x SunOS 4.x ConvexOS 10.x Dynix/ptx<br>
<br>
#REAL_DAEMON_DIR=/usr/etc<br>
<br>
#<br>
<br>
# SysV.4 Solaris 2.x OSF AIX<br>
<br>
REAL_DAEMON_DIR=/usr/sbin<br>
<br>
#<br>
<br>
# BSD 4.4<br>
<br>
#REAL_DAEMON_DIR=/usr/libexec<br>
<br>
#<br>
<br>
# HP-UX SCO Unicos<br>
<br>
#REAL_DAEMON_DIR=/etc<br>
<br>
2:在Makefile 中查找FACILITY= LOG_MAIL这几个关键字,Tcp_wrapper的纪录功能就是由这里实现的,系统默认是使用solaris的MAIL精灵来做连接纪录的,但这样会造成Tcp_wrapper的连接纪录和系统的mail日志混杂在一起,不利于管理员分辨.所以建议还是选用一个solaris中未使用的local精灵.我们在这里使用LOCAL3,即FACILITY= LOG_ LOCAL3 ,SEVERITY级别保持INFO级别不变。在读者的机器上可视情况而定用何种精灵。修改后即下面的形式:<br>
<br>
# The LOG_XXX names below are taken from the /usr/include/syslog.h file.<br>
<br>
FACILITY= LOG_LOCAL3 #LOG_MAIL is what most sendmail daemons use<br>
<br>
# The syslog priority at which successful connections are logged。<br>
<br>
SEVERITY= LOG_INFO # LOG_INFO is normally not logged to the console<br>
<br>
3:接着查找/etc/hosts.allow,/etc/hosts.deny,也就是上文提到的访问控制文件,建议将默认的/etc替换为其它路径。 由此Makefile编辑完成,退出vi,执行make sunos5(sunos5这个参数是由Makefile开始描述部分得到,采用其它操作系统的将sunos5替换为为相应参数即可)。我们可以看到系统在编译,成功后,在当前目录下会生成tcpd,tcpdmatch,safe_finger等5个可执行文件。建议选一个目录如/usr/local/sbin,将上述5个文件拷贝到这个目录中,至此Tcp_wrapper本身的编译工作就此结束。<br>
<br>
下一步,编辑/etc/inetd.conf,将原<br>
<br>
telnet stream tcp nowait root /usr/sbin/in.telnetd in.telnetd中的/usr/sbin/in.telnetd替换为tcpd及其所在路径,在此例中即<br>
<br>
telnet stream tcp nowait root /usr/local/sbin/tcpd in.telnetd<br>
<br>
其它ftp , tftp , rsh , rlogin等同样操作即可,建议至少替换telnet,ftp,rsh,rlogin这几个守护程序。<br>
<br>
编辑结束后,保存文件,ps –ef | grep inetd找出inetd的进程号,kill –HUP 重启inetd进程使改动生效。<br>
<br>
接着我们编辑/etc/syslog.conf文件,加入日志纪录功能,在此例中即<br>
<br>
#tcp wrapper log<br>
<br>
local3.info /var/log/tcplog<br>
<br>
编辑结束后,保存文件, 在/var/log下生成tcplog文件,注意这个文件的读写属性, 应该只对root有读写权限。然后ps –ef | grep syslogd,找出syslogd的进程号,kill –HUP 重启syslogd进程使改动生效。<br>
<br>
最后一项工作是编辑hosts.deny和hosts.allow文件,按上面的语法编辑即可。至此所有工作完成,我们可以用上述两个文件的设置来试一试,假设主机refuse(IP 11.22.33.44)telnet本机,我们看一看,会有什么反应?<br>
<br>
refuse#telnet www.yiming.com<br>
<br>
Trying www.yiming.com ...<br>
<br>
Connected to www.yiming.com<br>
<br>
Connection closed by foreign host.<br>
<br>
我们再看看本机Tcp_wrapper的日志,多了一条:<br>
<br>
Apr 2 13:56:20 yiming in.telnetd[1769]: refused connect from 11.22.33.44<br>
<br>
实际上这种测试可用Tcp_wrapper自带的测试文件tcpdmatch,使用很简单,格式tcpdmatch 守护程序 假定IP 即可,这里也不介绍了。<br>
</FONT><br>
                                      </TD>
                                    </TR>
                                <TR>
                                <TD colSpan=2><FONT 
                                class=middlefont></FONT><BR>
                                        <FONT 
                                class=normalfont>全文结束</FONT> </TD>
                                    </TR>
                                <TR>
                                <TD background="images/dot.gif" tppabs="http://www.linuxhero.com/docs/images/dot.gif" colSpan=2 
                                height=10></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV></TD>
                        <TD vAlign=top width="20%" 
                      background="images/line.gif" tppabs="http://www.linuxhero.com/docs/images/line.gif" rowSpan=2> 
                          <DIV align=center> 
                            <table class=tableoutline cellspacing=1 cellpadding=4 
                        width="100%" align=center border=0>
                              <tr class=firstalt> 
                                <td noWrap background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif" colspan=2 height=21>
                                <font class=normalfont><b>所有分类</b></font></td>
                              </tr>
<tr class=secondalt> <td noWrap width=27%> <font class=normalfont>1:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type1.html" tppabs="http://www.linuxhero.com/docs/type1.html">非技术类</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>2:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type2.html" tppabs="http://www.linuxhero.com/docs/type2.html">基础知识</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>3:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type3.html" tppabs="http://www.linuxhero.com/docs/type3.html">指令大全</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>4:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type4.html" tppabs="http://www.linuxhero.com/docs/type4.html">shell</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>5:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type5.html" tppabs="http://www.linuxhero.com/docs/type5.html">安装启动</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>6:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type6.html" tppabs="http://www.linuxhero.com/docs/type6.html">xwindow</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>7:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type7.html" tppabs="http://www.linuxhero.com/docs/type7.html">kde</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>8:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type8.html" tppabs="http://www.linuxhero.com/docs/type8.html">gnome</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>9:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type9.html" tppabs="http://www.linuxhero.com/docs/type9.html">输入法类</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>10:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type10.html" tppabs="http://www.linuxhero.com/docs/type10.html">美化汉化</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>11:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type11.html" tppabs="http://www.linuxhero.com/docs/type11.html">网络配置</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>12:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type12.html" tppabs="http://www.linuxhero.com/docs/type12.html">存储备份</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>13:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type13.html" tppabs="http://www.linuxhero.com/docs/type13.html">杂项工具</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>14:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type14.html" tppabs="http://www.linuxhero.com/docs/type14.html">编程技术</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>15:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type15.html" tppabs="http://www.linuxhero.com/docs/type15.html">网络安全</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>16:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type16.html" tppabs="http://www.linuxhero.com/docs/type16.html">内核技术</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>17:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type17.html" tppabs="http://www.linuxhero.com/docs/type17.html">速度优化</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>18:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type18.html" tppabs="http://www.linuxhero.com/docs/type18.html">apache</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>19:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type19.html" tppabs="http://www.linuxhero.com/docs/type19.html">email</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>20:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type20.html" tppabs="http://www.linuxhero.com/docs/type20.html">ftp服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>21:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type21.html" tppabs="http://www.linuxhero.com/docs/type21.html">cvs服务</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>22:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type22.html" tppabs="http://www.linuxhero.com/docs/type22.html">代理服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>23:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type23.html" tppabs="http://www.linuxhero.com/docs/type23.html">samba</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>24:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type24.html" tppabs="http://www.linuxhero.com/docs/type24.html">域名服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>25:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type25.html" tppabs="http://www.linuxhero.com/docs/type25.html">网络过滤</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>26:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type26.html" tppabs="http://www.linuxhero.com/docs/type26.html">其他服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>27:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type27.html" tppabs="http://www.linuxhero.com/docs/type27.html">nfs</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>28:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type28.html" tppabs="http://www.linuxhero.com/docs/type28.html">oracle</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>29:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type29.html" tppabs="http://www.linuxhero.com/docs/type29.html">dhcp</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>30:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type30.html" tppabs="http://www.linuxhero.com/docs/type30.html">mysql</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>31:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type31.html" tppabs="http://www.linuxhero.com/docs/type31.html">php</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>32:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type32.html" tppabs="http://www.linuxhero.com/docs/type32.html">ldap</a></font></td>    </tr>  </table></td></tr>                            </table>
                          </DIV></TD></TR>
                    <TR vAlign=top>
                        <TD width="80%"> 
                          <DIV align=center><BR>
                          </DIV>
                        </TD></TR></TBODY></TABLE></TD></TR>
                </TABLE></TD></TR>
          </TABLE>
      <TABLE cellSpacing=0 cellPadding=4 width="100%" bgColor=#eeeeee 
        border=0><TBODY>
        <TR>
          <TD width="50%">
              <P><FONT class=middlefont>版权所有 &copy; 2004 <A 
            href="mailto:bjchenxu@sina.com">linux知识宝库</A><BR>
                违者必究. </FONT></P>
            </TD>
          <TD width="50%">
              <DIV align=right><FONT class=middlefont>Powered by: <A 
            href="mailto:bjchenxu@sina.com">Linux知识宝库</A> Version 0.9.0 </FONT></DIV>
            </TD></TR></TBODY></TABLE>
      <CENTER></CENTER></TD></TR>
    </TABLE></CENTER></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -