📄 866.html
字号:
} <br>
<br>
Service telnet <br>
{ <br>
Socket_type=stream <br>
protocol=tcp <br>
wait=no <br>
flags=REUSE <br>
user=root <br>
bind=201.171.99.99 <br>
redirect=172.17.1.1 23 <br>
Log_on_success=PID HOST EXIT DURATION USERID <br>
LOG_ON_FAILURE=record host <br>
} <br>
<br>
例 16 redirect的结果 <br>
<br>
$ telnet 201.171.99.99 <br>
Trying 201.171.99.99 <br>
Connected to 201.171.99.99 <br>
Escape character is‘^]’ <br>
UNIX(r) System V Release 4.0 (foghorn) <br>
Login: <br>
<br>
<br>
因为Linux对每个物理端口最多支持256个逻辑接口,因此理论上可以为系统上的每个物理地址代理256个不同的地址。 <br>
<br>
尽管redirect机制可能是非常有用的,但实现它时要小心。要确保在代理服务器和终端系统上进行登记。可是在高度受控的内部网络中,这个实现可能是方便的。 <br>
<br>
包含TCP_Wrappers <br>
<br>
/etc/xinetd.conf中包含TCP_Wrappers功能是如此简单,TCP_Wrappers的所有功能可通过xinetd包括进去,就像通过inetd一样。例17是/etc/xinetd.conf文件的一个实例,它为许多服务使用了TCP_Wrappers。当属性服务器设置为/usr/sbin/tcpd后,那个服务将被包裹。注意这样的项总是把server_args属性设置为要激活的进程(全路径)。载讨论xinetd 的编译时,用到了libwrap配置选项,但是无论是否用libwrap编译,例17中的配置文件都能发挥作用。用libwrap编译的作用是包含 /etc/hosts.allow和/etc/hosts.deny中的访问限制。例7所示提供了TCP_Wrappers的一组完整特征, banners,spawn,twist等。 <br>
<br>
例 17 在/etc/xinetd.conf中使用TCP_Wrappers <br>
<br>
Defaults <br>
{ <br>
Log_type=SYSLOG loca14 info <br>
Log_on_success=PID HOST EXIT DURATION <br>
Log_on_failure=HOST <br>
instances=8 <br>
} <br>
Service ftp <br>
{ <br>
id=ftp <br>
Socket_type=stream <br>
protocol=tcp <br>
wait=no <br>
user=root <br>
Only_from=172.17.0.0 <br>
Log_on_success+=USERID <br>
Log_on_failure+=USERID <br>
Access_times=8:00-16:30 <br>
server= /usr/sbin/tcpd <br>
Server_args= /usr/sbin/in.ftpd –1 –a <br>
} <br>
<br>
Service telnet <br>
{ <br>
Socket_type=stream <br>
wait=no <br>
flags=NAMEINARGS REUSE <br>
User=root <br>
Bind=172.17.33.111 <br>
server= /usr/sbin/tcpd <br>
Server_args= /usr/sbin/in.telnetd <br>
Log_on_success=PID HOST EXIT DURATION USERID <br>
Log_on_failure=RECORD HOST <br>
} <br>
<br>
Service telnet <br>
{ <br>
Socket_type=stream <br>
protocol=tcp <br>
wait=no <br>
flags=REUSE <br>
user=root <br>
bind=201.171.99.99 <br>
redirect=172.17.1.1 23 <br>
Log_on_success=PID HOST EXIT DURATION USERID <br>
Log_on_failure=RECORD HOST <br>
} <br>
… <br>
<br>
… <br>
<br>
<br>
xinetd进程 <br>
<br>
xinetd进程接受若干参数。这些参数可被特定服务default中的属性改写,或在一个或多个服务的单个属性项改写。然而,这里给出的所有参数或它们的缺省值控制xinetd自身的行为。例如,如果filelog标记指定为xinetd,那么将在那里登记所有状态转换消息,尽管 /etc/xinetd.conf文件中为和服务相关消息指定了其他登记位置。可用参数列在表5中。 <br>
<br>
应注意xinetd报告的所有状态信息,总是出现在-syslog或-filelog标记指定的登记文件中,不管设置如何,即通过defaults还是在/etc/xinetd.conf中。如果要在一个文件中捕获xinetd的PID,可以用 <br>
<br>
xinetd –pid 2> /var/run.xinetd.pid <br>
<br>
和xinetd一起使用的可用信号 xinetd进程也基于收到的信号采取特定的行动。表16描述了它接受的每个信号的功能。注意每当增加了新服务或defaults项,或每当改变了任何服务的如下属性:protocol,socket_type,type或wait时,必须用SIGTERM(或更简单的TERM)信号中止xientd。每当给xinetd发布一个软性或硬性重配置信号时,将写入例19中所示类型的登记项。这个特定例子是硬性重配置的结果。注意这次硬性重配置的结果是中止了一项服务(用dropped=1标识)。 <br>
<br>
<br>
<br>
表 5 xinetd的标记 <br>
<br>
标 记 <br>
描 述 <br>
<br>
-d <br>
调试模式。输出可和调试器如gdb一起使用 <br>
<br>
-sysllog facility <br>
指定syslogd工具。是daemon, auth, user和loca10-7其中之一 <br>
<br>
-filelog file <br>
指定登记写到file而不是syslog中。必须是完整路径名 <br>
<br>
-fconfig_file <br>
指定配置文件。必须是完整路径名。缺省是/etc/xinetd.conf <br>
<br>
-pid <br>
把PID写入标准错误中 <br>
<br>
-loop rate <br>
指定每秒钟分叉的进程数。缺省是10.对较快机器来说可能希望改变它 <br>
<br>
-reuse <br>
设置可重用的TCP socket,这意味着以前的实例运行时也可启动其他进程。当和flags属性一起使用时,有更特殊的服务控制(参看表10.10) <br>
<br>
-limit numproc <br>
限制由xinetd启动的同时运行的进程总数为numproc <br>
<br>
- <br>
限制同时发生的RFC1413请求数为limit <br>
<br>
-shutdownprocs limit <br>
当log_on_failure属性中使用了RECORD值时,xinetd分叉称为shutdown的服务以收集服务终止时的信息。该选项限制同时运行的shutdown进程总数为limit <br>
<br>
-cc interval <br>
使xinetd每隔interval秒运行对其内部状态的一致性检查。用killall –IOT xinetd可手工实现 <br>
<br>
<br>
表18 xinetd信号 <br>
<br>
信 号 <br>
作 用 <br>
<br>
SIGUSR1 <br>
软性重配置。重读/etc/xinetd.conf并作相应调整 <br>
<br>
SIGUSR2 <br>
硬性重配置。重读/etc/xinetd.conf并杀死和配置文件中的建立准则不再匹配的所有进程。例如,如果一个客户机连接到这个服务器且又增加到no_access表中,那么这个信号会终止该客户机的会话 <br>
<br>
SIGQUIT <br>
终止xinetd但不终止它分叉的任何进程 <br>
<br>
SIGTERM <br>
终止xinetd分叉的所有进程;然后终止xinetd <br>
<br>
SIGHUP <br>
把xinetd状态信息写到/tmp/xinetd.dump中 <br>
<br>
SIGIOT <br>
检查内部数据库毁坏情况并报告结果 <br>
<br>
<br>
例19 xinetd硬性重配置的登记记录 <br>
<br>
Apr 15 14:42:31 topcat xinetd[1402]:Starting hard reconfiguration <br>
Apr 15 14:42:31 topcat xinetd[1402]:readjusting service servers <br>
Apr 15 14:42:31 topcat xinetd[1402]:readjusting service servces <br>
Apr 15 14:42:31 topcat xinetd[1402]:readjusting service telnet <br>
Apr 15 14:42:31 topcat xinetd[1402]:readjusting service shell <br>
Apr 15 14:42:31 topcat xinetd[1402]:readjusting service login <br>
Apr 15 14:42:31 topcat xinetd[1402]:readjusting service talk <br>
Apr 15 14:42:31 topcat xinetd[1402]:readjusting service ntalk <br>
Apr 15 14:42:31 topcat xinetd[1402]:readjusting service pop-2 <br>
Apr 15 14:42:31 topcat xinetd[1402]:readjusting service pop-3 <br>
Apr 15 14:42:31 topcat xinetd[1402]:readjusting service imap <br>
Apr 15 14:42:31 topcat xinetd[1402]:readjusting service linuxconf <br>
Apr 15 14:42:31 topcat xinetd[1402]:readjusting service ftp <br>
Apr 15 14:42:31 topcat xinetd[1402]:Reconfigured:new=1 old=12 dropped=1 (services) <br>
<br>
<br>
注:确定某个修改的/etc/xinetd.conf文件被读的最可靠方式是停止并重启动xinetd进程。最好用SIGTERM信号中止 xinetd。如这节中描述的,发给xzinetd一个SIGTERM使它中止(用SIGKILL或信号号9)其控制之下的每个进程。有时在xinetd 的子进程中止之前有一个延时,这意味着如果杀死并立即重启动xinetd,它不可能绑定所有端口(对此xinetd的登记文件----而不是这项服务指定的登记文件----中含一个错误消息)。这就是为什么sleep3命令出现在例中的stop和start命令间的脚本中。对TCP服务如telnet和 ftp用flags=REUSE属性及其值或指定xinetd自身的-reuse选项可完全消除这个问题。
</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>版权所有 © 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 + -