📄 5.t
字号:
has certain advantages over the routing daemon, but isunsuitable in an environment where there are only bridges (i.e.pseudo gateways that, for instance, do not generate routingredirect messages). Further, if thesmart gateway goes down there is no alternative, save manualalteration of the routing table entry, to maintaining service..PPThe system always listens, and processes, routing redirectinformation, so it is possible to combine both of the abovefacilities. For example, the routing table management processmight be used to maintain up to date information about routesto geographically local networks, while employing the wildcardrouting techniques for ``distant'' networks. The.Xr netstat (1)program may be used to display routing table contents as wellas various routing oriented statistics. For example,.DS\fB#\fP \fInetstat \-r\fP.DEwill display the contents of the routing tables, while.DS\fB#\fP \fInetstat \-r \-s\fP.DEwill show the number of routing table entries dynamicallycreated as a result of routing redirect messages, etc..Sh 2 "Use of \*(4B machines as gateways".PPSeveral changes have been made in \*(4B in the area of gateway support(or packet forwarding, if one prefers).A new configuration option, GATEWAY, is used when configuringa machine to be used as a gateway.This option increases the size of the routing hash tables in the kernel.Unless configured with that option,hosts with only a single non-loopback interface never attemptto forward packets or to respond with ICMP error messages to misdirectedpackets.This change reduces the problems that may occur when different hostson a network disagree on the network number or broadcast address.Another change is that \*(4B machines that forward packets back throughthe same interface on which they arrivedwill send ICMP redirects to the source host if it is on the same network.This improves the interaction of \*(4B gateways with hosts that configuretheir routes via default gateways and redirects.The generation of redirects may be disabled with the configuration optionIPSENDREDIRECTS=0 or while the system is running by using the command:.DS.ft CWsysctl -w net.inet.ip.redirect=0.DEin environments where it may cause difficulties..Sh 2 "Network databases".PPSeveral data files are used by the network library routinesand server programs. Most of these files are host independentand updated only rarely..br.ne 1i.TSlfC l l.File Manual reference Use_/etc/hosts \fIhosts\fP\|(5) local host names/etc/networks \fInetworks\fP\|(5) network names/etc/services \fIservices\fP\|(5) list of known services/etc/protocols \fIprotocols\fP\|(5) protocol names/etc/hosts.equiv \fIrshd\fP\|(8) list of ``trusted'' hosts/etc/netstart \fIrc\fP\|(8) command script for initializing network/etc/rc \fIrc\fP\|(8) command script for starting standard servers/etc/rc.local \fIrc\fP\|(8) command script for starting local servers/etc/ftpusers \fIftpd\fP\|(8) list of ``unwelcome'' ftp users/etc/hosts.lpd \fIlpd\fP\|(8) list of hosts allowed to access printers/etc/inetd.conf \fIinetd\fP\|(8) list of servers started by \fIinetd\fP.TEThe files distributed are set up for Internet hosts.Local networks and hosts should be added to describe the localconfiguration; the Berkeley entries may serve as examples(see also the section on.Pn /etc/hosts ).Network numbers will have to be chosen for each Ethernet.For sites connected to the Internet,the normal channels should be used for allocation of networknumbers (contact hostmaster@SRI-NIC.ARPA).For other sites,these could be chosen more or less arbitrarily,but it is generally better to request official numbersto avoid conversion if a connection to the Internet (or others on the Internet)is ever established..Sh 3 "Network servers".PPMost network servers are automatically started up at boot timeby the command file.Pn /etc/rcor by the Internet daemon (see below).These include the following:.TSlfC l l.Program Server Started by_/usr/sbin/syslogd error logging server \f(CW/etc/rc\fP/usr/sbin/named Internet name server \f(CW/etc/rc\fP/sbin/routed routing table management daemon \f(CW/etc/rc\fP/usr/sbin/rwhod system status daemon \f(CW/etc/rc\fP/usr/sbin/timed time synchronization daemon \f(CW/etc/rc\fP/usr/sbin/sendmail SMTP server \f(CW/etc/rc\fP/usr/libexec/rshd shell server inetd/usr/libexec/rexecd exec server inetd/usr/libexec/rlogind login server inetd/usr/libexec/telnetd TELNET server inetd/usr/libexec/ftpd FTP server inetd/usr/libexec/fingerd Finger server inetd/usr/libexec/tftpd TFTP server inetd.TEConsult the manual pages and accompanying documentation (particularlyfor named and sendmail) for details about their operation..PPThe use of.Xr routedand.Xr rwhodis controlled by shellvariables set in.Pn /etc/netstart .By default,.Xr routedis used, but.Xr rwhodis not; they are enabled by setting the variables \fIroutedflags\fP and.Xr rwhodto strings other than ``NO.''The value of \fIroutedflags\fP provides host-specific options to.Xr routed .For example,.DS.ft CWroutedflags=-qrwhod=NO.DEwould run.Xr "routed -q"and would not run.Xr rwhod ..PPTo have other network servers started as well,commands of the following sort should be placed in the site-dependent file.Pn /etc/rc.local ..DS.ft CWif [ -f /usr/sbin/timed ]; then /usr/sbin/timed & echo -n ' timed' >/dev/consolef\&i.DE.Sh 3 "Internet daemon".PPIn \*(4B most of the servers for user-visible services are started up by a``super server'', the Internet daemon. The Internetdaemon,.Pn /usr/sbin/inetd ,acts as a master server forprograms specified in its configuration file,.Pn /etc/inetd.conf ,listening for service requests for these servers, and startingup the appropriate program whenever a request is received.The configuration file contains lines containing a servicename (as found in.Pn /etc/services ),the type of socket theserver expects (e.g. stream or dgram), the protocol to beused with the socket (as found in.Pn /etc/protocols ),whether to wait for each server to complete before starting up another,the user name by which the server should run, the serverprogram's name, and at most five arguments to pass to theserver program.Some trivial services are implemented internally in.Xr inetd ,and their servers are listed as ``internal.''For example, an entry for the filetransfer protocol server would appear as.DS.ft CWftp stream tcp nowait root /usr/libexec/ftpd ftpd.DEConsult.Xr inetd (8)for more detail on the format of the configuration fileand the operation of the Internet daemon..Sh 3 "The \f(CW/etc/hosts.equiv\fP file".PPThe remote login and shell servers use anauthentication scheme based on trusted hosts. The.Pn hosts.equivfile contains a list of hosts that are considered trustedand, under a single administrative control. When a usercontacts a remote login or shell server requesting service,the client process passes the user's name and the officialname of the host on which the client is located. In the simplecase, if the host's name is located in.Pn hosts.equivand the user has an account on the server's machine, then serviceis rendered (i.e. the user is allowed to log in, or the commandis executed). Users may expand this ``equivalence'' ofmachines by installing a.Pn \&.rhostsfile in their login directory.The root login is handled specially, bypassing the.Pn hosts.equivfile, and using only the.Pn /.rhostsfile..PPThus, to create a class of equivalent machines, the.Pn hosts.equivfile should contain the \fIofficial\fP names for those machines.If you are running the name server, you may omit the domain partof the host name for machines in your local domain.For example, four machines on our localnetwork are considered trusted, so the.Pn hosts.equivfile is of the form:.DS.ft CWvangogh.CS.Berkeley.EDUpicasso.CS.Berkeley.EDUokeeffe.CS.Berkeley.EDU.DE.Sh 3 "The \f(CW/etc/ftpusers\fP file".PPThe FTP server included in the system provides support for ananonymous FTP account. Because of the inherent security problemswith such a facility you should read this section carefully ifyou consider providing such a service..PPAn anonymous account is enabled by creating a user.Xr ftp .When a client uses the anonymous account a.Xr chroot (2)system call is performed by the server to restrict the clientfrom moving outside that part of the filesystem where theuser ftp home directory is located. Because a.Xr chrootcall is used, certain programs and files used by the serverprocess must be placed in the ftp home directory.Further, one must besure that all directories and executable images are unwritable.The following directory setup is recommended. Theuse of the.Xr awkcommands to copy the.Pn /etc/passwdand.Pn /etc/groupfiles are \fBSTRONGLY\fP recommended..DS\fB#\fP \fIcd ~ftp\fP\fB#\fP \fIchmod 555 .; chown ftp .; chgrp ftp .\fP\fB#\fP \fImkdir bin etc pub\fP\fB#\fP \fIchown root bin etc\fP\fB#\fP \fIchmod 555 bin etc\fP\fB#\fP \fIchown ftp pub\fP\fB#\fP \fIchmod 777 pub\fP\fB#\fP \fIcd bin\fP\fB#\fP \fIcp /bin/sh /bin/ls .\fP\fB#\fP \fIchmod 111 sh ls\fP\fB#\fP \fIcd ../etc\fP\fB#\fP \fIawk -F: '{$2="*";print$1":"$2":"$3":"$4":"$5":"$6":"}' < /etc/passwd > passwd\fP\fB#\fP \fIawk -F: '{$2="*";print$1":"$2":"}' < /etc/group > group\fP\fB#\fP \fIchmod 444 passwd group\fP.DEWhen local users wish to place files in the anonymousarea, they must be placed in a subdirectory. In thesetup here, the directory.Pn ~ftp/pubis used..PPAside from the problems of directory modes and such,the ftp server may provide a loophole for interlopersif certain user accounts are allowed.The file.Pn /etc/ftpusersis checked on each connection.If the requested user name is located in the file, therequest for service is denied. This file normally hasthe following names on our systems..DSuucproot.DEAccounts without passwords need not be listed in this file as the ftpserver will refuse service to these users.Accounts with nonstandard shells (any not listed in.Pn /etc/shells )will also be denied access via ftp.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -