📄 00000000.htm
字号:
<HTML><HEAD> <TITLE>BBS水木清华站∶精华区</TITLE></HEAD><BODY><CENTER><H1>BBS水木清华站∶精华区</H1></CENTER>发信人: jester (玩笑鬼), 信区: Linux <BR>标 题: an unofficial xinetd tutorial <BR>发信站: BBS 水木清华站 (Wed Nov 29 09:29:47 2000) <BR> <BR>An Unofficial Xinetd Tutorial <BR>by curator, The Shmoo Group. <BR>Contents: <BR>What xinetd does <BR>Installation <BR>Configuration file basics <BR>A Simple Configuration with little access control <BR>A More Complicated Configuration with Access Control <BR>Day to day use of xinetd (or updating the xinetd.conf) <BR>Port redirection <BR>Additional info for Mac OS X (Server) <BR>Parting words <BR>---------------------------------------------------------------------------- <BR>---- <BR>What xinetd does <BR>xinetd is a secure replacement for inetd, and a more efficient replacement f <BR>or inetd and tcp_wrappers. It sports a number of features that make it a goo <BR>d choice for securing a server. These include access control (based on sourc <BR>e address, destination address, and time), extensive logging, and the abilit <BR>y to bind services to specific interfaces. This tutorial will attempt to giv <BR>e an administrator the necessary tools to install, configure, and maintain x <BR>inetd. <BR>Being a "secure replacement for inetd", xinetd attempts to do everything tha <BR>t inetd does, only securely. This means that, like inetd, it is a super-serv <BR>er. Both xinetd and inetd read in their configuration files which are basica <BR>lly a list of IP services to listen to. The super-servers "listen" on the po <BR>rts defined by those listed in configuration files for connection attemps on <BR> those ports. When it receives a connection on a port it thinks it has a ser <BR>vice for, it attempts to start the requisite server. There are exceptions to <BR> this scheme, mostly for single-threaded servers, where the super-servers si <BR>mply start the server, which then takes care of service requests until the s <BR>erver dies. <BR>Where inetd and xinetd begin to differ is xinetd's support for RPC services; <BR> it isn't great. The author of xinetd suggests that an admin running an rpc <BR>service do so from inetd. xinetd and inetd can cohabitate quite peacefully. <BR>Another thing that differs is the configuration files; the two are mutually <BR>incompatible. xinetd's conf file contains more information than inetd does i <BR>n order to handle the additional security parameters. <BR>---------------------------------------------------------------------------- <BR>---- <BR>Installation <BR>First you need to download the latest source from xinetd.org to some conveni <BR>ent directory (ie., /usr/local/src). Once downloaded, expand the archive and <BR> change to its directory. (If running Mac OS X(S), there is a section later <BR>in this tutorial that has additional to assist you in this process.) <BR>It is possible to compile xinetd with libwrap support by adding the --with-l <BR>ibwrap flag to ./configure. This allows xinetd to use the hosts.{allow | den <BR>y} mechanism. To do so, you'll need to have tcp_wrappers installed, and the <BR>requisite libraries in place. The decision to do so is up to the individual <BR>admin. This option exists mostly to help those more comfortable with the wra <BR>pper mechanism to more easily configure xinetd. We suggest that you do not c <BR>ompile the software with libwrap support unless you have the need; it is bes <BR>t and most flexible to do without it. <BR>Further options are available (such as install paths, ipv6 support, etc) and <BR> you should read the install docs to determince which of these settings is c <BR>orrect for you. <BR>Once you've run ./configure with the options you need, run "make" followed b <BR>y "make install" as root. Assuming xinetd makes and installs with no errors, <BR> the next thing to do is configure it. If it doesn't, you may wish to subscr <BR>ibe to the xinetd maillist by sending a message to <A HREF="mailto:majordomo@synack.net">majordomo@synack.net</A> with <BR> a body of "subscribe xinetd". <BR>---------------------------------------------------------------------------- <BR>---- <BR>Configuration file basics <BR>xinetd ships with a perl script (installed in the same directory as the xine <BR>td binary) that conveniently converts an inetd.conf into a xinetd.conf. It m <BR>ay be invoked as "/usr/sbin/xconv.pl < /etc/inetd.conf > /tmp/xinetd.conf", <BR>where "/usr/sbin" is your path to the xinetd executable. <BR>xconv.pl will try to make a xinetd.conf from your original inetd.conf as bes <BR>t it can, but most admins will want (read: need) to modify the xinetd.conf i <BR>t generates. For instance, many BSD's (including Mac OS X [Server]) require <BR>that each service have a "groups = yes" setting. <BR>The defaults section <BR>xconv.pl by default makes a defaults section that looks something like this: <BR> <BR> defaults <BR> { <BR> #The maximum number of requests a particular service may handle <BR> # at once. <BR> instances = 25 <BR> # The type of logging. This logs to a file that is specified. <BR> # Another option is: SYSLOG syslog_facility [syslog_level] <BR> log_type = FILE /var/log/servicelog <BR> # What to log when the connection succeeds. <BR> # PID logs the pid of the server processing the request. <BR> # HOST logs the remote host's ip address. <BR> # USERID logs the remote user (using RFC 1413) <BR> # EXIT logs the exit status of the server. <BR> # DURATION logs the duration of the session. <BR> log_on_success = HOST PID <BR> # What to log when the connection fails. Same options as above <BR> log_on_failure = HOST RECORD <BR> # The maximum number of connections a specific IP address can <BR> # have to a specific service. <BR> per_source = 5 <BR> } <BR>Here we can begin to see some of the basic characteristics of a conf file. S <BR>ections have the general form: <BR> sectiontypeorname <BR> { <BR> <attribute> <assign_op> <value><value> ... <BR> <anotherattribute> <assign_op> <value><value> ... <BR> ... <BR> } <BR>Lines beginning with "#" are comments. Whitespace lines are ignored. There c <BR>an be only one defaults section in a xinetd.conf file. In the defaults secti <BR>on the assign_op is only a "=". <BR>The defaults section, as its name implies, specifies default settings for th <BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -