?? 00000143.htm
字號:
And here is the same record after modification to support TCP Wrappers: <BR>telnet stream tcp nowait root /sbin/tcpd /sbin/in.telnetd <BR>Remember after editing this file to tell inetd to re-read it with kill -1. <BR>Configuration <BR>Access Control <BR>The core idea behind TCP Wrappers is that of an access-control policy. The <BR>policy rules are held in two files: /etc/hosts.allow and /etc/hosts.deny. <BR>These are the default pathnames, which can be changed in the Makefile. <BR>Access can be controlled per host, per service, or in combinations thereof. <BR>Access control also can be used to connect clients to particular services, <BR>depending on the requested service, the origin of the request, and to what <BR>host address the client <BR>connects. For example, a www daemon might serve documents in the native <BR>language when contacted from within the same country, but default to English <BR>otherwise. <BR>The format of these files is described in detail by hosts_access(5). Each <BR>file consists of a set of rules that are searched first in hosts.allow, then <BR>in hosts.deny. The search stops at the first match, so if a host is granted <BR>access in hosts.allow, it <BR>doesn't matter if it is blocked in hosts.deny. <BR>There are two basic keywords, "allow" and "deny." These are used in <BR>conjunction with specific hostnames, or a wildcard from the following list: <BR>A string beginning with "." matches all hostnames that conclude with that <BR>string. For example, .example.com would match dunne.example.com. <BR>A string ending with "." matches all hosts whose IP addresses begin with that <BR>sequence. For example, 192.168. would match all addresses in the range <BR>192.168.xxx.xxx. <BR>A string beginning with "@" is treated as an NIS netgroup name. <BR>A string of the form n.n.n.n/m.m.m.m is treated as a network/mask pair. <BR>There also are some special shorthand names: <BR>ALL <BR>Always matches. <BR>LOCAL <BR>Matches any host whose name does not contain a dot character. <BR>UNKNOWN <BR>Matches a user whose name is unknown, and matches any host whose name or <BR>address are unknown. <BR>KNOWN <BR>Matches a user whose name is known, and matches any host whose name and <BR>address is known. <BR>PARANOID <BR>Matches any host whose name does not match its address. <BR>There also is a set of symbolic names that expand to various information <BR>about the client and server. The full list of such expansions is: <BR>%a <BR>the client IP address <BR>%c <BR>client information: user@host, user@ <BR>%d <BR>argv[0] from the daemon process <BR>%h <BR>client hostname or IP address <BR>%n <BR>client hostname <BR>%p <BR>process id of the daemon <BR>%s <BR>server information <BR>%u <BR>client username <BR>%% <BR>literal "%" <BR>Examples <BR>There are several typical forms of access control that provide examples of <BR>using the access control files. note that explicitly-authorized hosts are <BR>listed in hosts.allow; most other rules are put in hosts.deny. <BR>To deny all access, leave hosts.allow blank, and put this in hosts.deny: <BR>ALL: ALL <BR>To allow all access, simply leave both files blank. <BR>To allow controlled access, add rules to hosts.allow and hosts.deny as <BR>appropriate. At it's simplest, this involves listing banned sites in <BR>hosts.deny: <BR>evilcrackers.com: ALL <BR>On the other hand, you can also deny access to all save selected sites: <BR>/etc/hosts.allow: <BR>example.com:ALL <BR>/etc/hosts.deny: <BR>ALL:ALL <BR>Remember, the first match is the one that counts -- the "ALL" in hosts.deny <BR>won't block example.com. <BR>Booby Traps <BR>A useful feature is the ability to trigger actions on the host based on <BR>attempted connections. For example, if we detect a remote site attempting to <BR>use our tftp server, the following rule in /etc/hosts.deny not only rejects <BR>the attempt, but notifies <BR>the system administrator: <BR>in.tftpd: ALL: spawn finger -l @%h 2>&1 | mail -s "remote tftp attempt" sysadm <BR>The use of this feature relies on the PROCESS_OPTIONS option. This option <BR>also provides some other useful features. <BR>spawn <shell_command> <BR>Runs the specified shell command as a child process. <BR>twist <shell_command> <BR>Replaces the current process by the specified shell command. <BR>banners <pathname> <BR>Copies the contents of the file in <pathname> to the client. Useful for sites <BR>that are required to display a site policy banner to all users. <BR>See the host_options(5) man page for full details of these and other options. <BR>Logging <BR>Log records are written to the syslog daemon, syslogd, with facility and <BR>level as specified in the Makefile at compile time. What happens to them <BR>there is determined by the syslogd config file /etc/syslog.conf. If <BR>PROCESS_OPTIONS has been defined, the <BR>facility and level can be changed at run time by using the keyword <BR>"severity," for example, <BR>severity mail.info <BR>specifies a facility "mail," level "info." An undotted argument is understood <BR>as a level. <BR>Resources <BR>In addition to the thorough set of man pages that comes with the software, <BR>Venema's paper, "TCP WRAPPER: Network monitoring, access control, and booby <BR>traps," is a useful account of the thinking that led to the creation of the <BR>software. It is available <BR>at <A HREF="ftp://ftp.porcupine.org/pub/security/">ftp://ftp.porcupine.org/pub/security/</A> in ASCII text and PostScript -- look <BR>for tcp_wrapper.<format>.Z. <BR>Conclusion <BR>TCP Wrappers protects against many common attempts to compromise a UNIX <BR>machine connected to the Internet. TCP Wrappers is easy to use: there is no <BR>need to modify existing software, only simple (and optional) changes to one <BR>existing configuration file <BR>are necessary, and there is no impact on genuine users. For your efforts, you <BR>get protection against a variety of cracking techniques and the ability to <BR>install trip wires to notify you of attempted break-ins. It's easy to see why <BR>millions of systems <BR>worldwide have installed this valuable tool. <BR>Paul Dunne (<A HREF="http://dunne.home.dhs.org)">http://dunne.home.dhs.org)</A> is a writer and consultant <BR>specializing in Linux.. <BR>-- <BR> ^\ ..... ( ^ ) ..... /^ <BR> ^-^ ^^^^^^ { 0 0 } ^^^^^^ ^-^ <BR> ^ ^^ ( @ ) ^^ ^ <BR> " <BR> I am back from hell <BR> Tears still leave in heaven <BR> <BR>※ 修改:·CuteGuy 於 May 2 12:34:46 修改本文·[FROM: rock.cs.uestc.e] <BR>※ 來源:·BBS 水木清華站 bbs.net.tsinghua.edu.cn·[FROM: rock.cs.uestc.e] <BR><CENTER><H1>BBS水木清華站∶精華區(qū)</H1></CENTER></BODY></HTML>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -