📄 00000000.htm
字号:
service ftp <BR> { <BR> socket_type = stream <BR> wait = no <BR> user = root <BR> server = /usr/libexec/ftpd <BR> server_args = -l <BR> } <BR>If you happen to be using rpc services, protocol, rpc_version, and rpc_numbe <BR>r (if it's not listed in /etc/rpc or your equivalent) attributes are also ma <BR>ndatory. <BR>For the most part these are the attributes that are required to properly con <BR>figure a service under xinetd. There are, however, two exceptions: if you're <BR> running a BSD, or if the service you're configuring isn't listed in /etc/se <BR>rvices (or equivalent). Most BSD's seem to require the addition of the group <BR>s (groups = yes) attribute to the service configuration. If you happen to be <BR> configuring a service that isn't in /etc/servicesport = 22, for sshd). Ther <BR>e are some additional variations when dealing with xinetd's internal's servi <BR>ces, but we'll discuss those later. <BR>This is, of course, not the end of the story; we want to not only have funct <BR>ioning services, we want to control access to these services. To this end, x <BR>inetd provides us with a number of pertinent service attributes: instances, <BR>nice, only_from, no_access, access_times, per_source, cps, and max_load. <BR>Instances accepts an integer as it's value, and as noted in the previous def <BR>aults section, specifies the maximum number of simultaneous connections to t <BR>he particular service. As with any of these values, setting this attribute i <BR>n the service definition should override whatever is in the defaults section <BR>. Nice is related to the unix nice command. It takes an integer that specifi <BR>es the services process priority. The max_load attribute accepts a floating <BR>point value, and specifies the load at which the server will stop accepting <BR>connections, based on a one-minute cpu load average. Due to it's OS dependen <BR>cy, this only works on Linux and Solaris right now. Then there's the cps att <BR>ribute, which also takes an integer and is used to rate limit (in connection <BR>s per second) a service. The last of these quantitative limiters is the per_ <BR>source attribute. It takes an integer and set the limit on the maximum numbe <BR>r of connections a single host may have to the specified service. <BR>The attributes only_from and no_access are very much related too each other, <BR> in as much as they take the same values, and are of supplimentary function. <BR> The accept a list of ip addresses, network names (via /etc/networks or equi <BR>valent), host/domain names (via reverse lookup), or networks (in CIDR notati <BR>on). If both only_from and no_access are specified for a service, the best f <BR>it match is used (ie, a host is a better match than a network, is better tha <BR>n a network with a larger subnet). The no_access attribute takes precedence <BR>over only_from in case of a complete duplication. If you include either attr <BR>ibute, but leave either blank, they disallow all addresses. The last access <BR>control attribute is access_times. This accepts time intervals in HH:MM-HH:M <BR>M 24-hour notation. Access is granted during these intervals. <BR>The remaining attributes have to do with logging (and have already been disc <BR>ussed in the defaults section), and some nuances of service configuration. S <BR>ome are covered in a later section, but for more information on these handfu <BR>ll of attributes, I would recommend reading the man pages. <BR>---------------------------------------------------------------------------- <BR>---- <BR>A Simple Configuration with little access control <BR># This is a modified and cleaned up version of a xinetd.conf <BR># originally created by xconv.pl. <BR># The defaults section sets some information for all services <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 = 25 <BR>} <BR>service ftp <BR>{ <BR> socket_type = stream <BR> wait = no <BR> user = root <BR> server = /usr/libexec/ftpd <BR> server_args = -l <BR>} <BR>service nntp <BR>{ <BR> socket_type = stream <BR> wait = no <BR> user = usenet <BR> server = /usr/libexec/nntpd <BR> server_args = <BR>} <BR>service telnet <BR>{ <BR> socket_type = stream <BR> wait = no <BR> user = root <BR> server = /usr/libexec/telnetd <BR> server_args = <BR>} <BR>---------------------------------------------------------------------------- <BR>---- <BR>A More Complicated Configuration with Access Control <BR># This is a modified and cleaned up version of a xinetd.conf <BR># originally created by xconv.pl. <BR># The defaults section sets some information for all services <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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -