📄 firewall-howto-7.html
字号:
</PRE>r-command如同telnet的同一方式设定。<PRE> # rlogin gateway rules: rlogin-gw: denial-msg /usr/local/etc/rlogin-deny.txt rlogin-gw: welcome-msg /usr/local/etc/rlogin-welcome.txt rlogin-gw: help-msg /usr/local/etc/rlogin-help.txt rlogin-gw: timeout 90 rlogin-gw: permit-hosts 196.1.2.* -passok -xok rlogin-gw: permit-hosts * -auth -xok # Only the Administrator can telnet directly to the Firewall via Port netacl-rlogind: permit-hosts 196.1.2.202 -exec /usr/libexec/rlogind -a</PRE>任何人均不得直接进入防火墙,其中包括FTP,因此,不要把FTP伺服器放在防火墙上。再者,permit-hosts行允许保护网路内的任何人自由进入网际网路,其他人则必需表明身份。下文附上送到和收到的每份文档的记录(-log { retr stor })。FTP的timeout开关控制在多少时间後停止试接,以及在多少时间没有动作後,放弃试接。<PRE> # ftp gateway rules: ftp-gw: denial-msg /usr/local/etc/ftp-deny.txt ftp-gw: welcome-msg /usr/local/etc/ftp-welcome.txt ftp-gw: help-msg /usr/local/etc/ftp-help.txt ftp-gw: timeout 300 ftp-gw: permit-hosts 196.1.2.* -log { retr stor } ftp-gw: permit-hosts * -authall -log { retr stor }</PRE>通过WWW、gopher和浏览器进行的ftp由http-gw控制。最上面的两行建立一个目录,用于储存经由防火墙的ftp和WWW文件。在本例中,这些文件属root所有,因此放在只有root能够进入的目录内。WWW的连接应该短暂。它控制使用者在连接不通时的等待时间。<PRE> # www and gopher gateway rules: http-gw: userid root http-gw: directory /jail http-gw: timeout 90 http-gw: default-httpd www.afs.net http-gw: hosts 196.1.2.* -log { read write ftp } http-gw: deny-hosts * </PRE>ssl-gw实际上是一个任何人都可通过的网关。应当当心设定。在本例中,任何保护网路中的用户,除127.0.0.* 和192.1.1.* 外,均可连接网路外的任何伺服器,并只能使用443至563 埠号。443至563埠号一般称为SSL埠号。<PRE> # ssl gateway rules: ssl-gw: timeout 300 ssl-gw: hosts 196.1.2.* -dest { !127.0.0.* !192.1.1.* *:443:563 } ssl-gw: deny-hosts *</PRE>下面的例子说明如何利用plug-gw连接到新闻伺服器。在本例中,保护网路内的用户只允许连接到一个系统,即连接到它的新闻埠。第二行使新闻伺服器将其资料送到保护网路。对新闻伺服器的timeout时间设定应该比较长,因为多数用户大都联机阅读新闻。<PRE> # NetNews Pluged gateway plug-gw: timeout 3600 plug-gw: port nntp 196.1.2.* -plug-to 199.5.175.22 -port nntp plug-gw: port nntp 199.5.175.22 -plug-to 196.1.2.* -port nntp</PRE><P>Finger网关的设定至为简单。保护网路内的用户只要首先登录,就可使用防火墙上的finger程式。任何其他人就只收到一段message。<PRE> # Enable finger service --------设定finger功能 netacl-fingerd: permit-hosts 196.1.2.* -exec /usr/libexec/fingerd netacl-fingerd: permit-hosts * -exec /bin/cat /usr/local/etc/finger.txt</PRE>在这份HOWTO中,没有设定Mail和X-windows功能。如任何人有这方面的实例,请发email给我。<P><H3>inetd.conf的设置档</H3><P>下面附上/etc/inetd.conf的全部文档。所有不需要的功能都用#符号注销。在这份全部文档中显示取消了何种功能,以及显示如何设定新的防火墙功能。<PRE> #echo stream tcp nowait root internal #echo dgram udp wait root internal #discard stream tcp nowait root internal #discard dgram udp wait root internal #daytime stream tcp nowait root internal #daytime dgram udp wait root internal #chargen stream tcp nowait root internal #chargen dgram udp wait root internal # FTP firewall gateway --------FTP防火墙网关 ftp-gw stream tcp nowait.400 root /usr/local/etc/ftp-gw ftp-gw # Telnet firewall gateway------Telnet防火墙网关 telnet stream tcp nowait root /usr/local/etc/tn-gw /usr/local/etc/tn-gw # local telnet services------用户的telnet功能 telnet-a stream tcp nowait root /usr/local/etc/netacl in.telnetd # Gopher firewall gateway------Gopher防火墙网关 gopher stream tcp nowait.400 root /usr/local/etc/http-gw /usr/local/etc/http-gw # WWW firewall gateway------WWW防火墙网关 http stream tcp nowait.400 root /usr/local/etc/http-gw /usr/local/etc/http-gw # SSL firewall gateway------SSL防火墙网关 ssl-gw stream tcp nowait root /usr/local/etc/ssl-gw ssl-gw # NetNews firewall proxy (using plug-gw)------NetNews防火墙代理伺服器(使用plug-gw) nntp stream tcp nowait root /usr/local/etc/plug-gw plug-gw nntp #nntp stream tcp nowait root /usr/sbin/tcpd in.nntpd # SMTP (email) firewall gateway------SMTP(email)防火墙网关 #smtp stream tcp nowait root /usr/local/etc/smap smap # # Shell, login, exec and talk are BSD protocols------ Shell, login, exec and talk均属BSD协议 # #shell stream tcp nowait root /usr/sbin/tcpd in.rshd #login stream tcp nowait root /usr/sbin/tcpd in.rlogind #exec stream tcp nowait root /usr/sbin/tcpd in.rexecd #talk dgram udp wait root /usr/sbin/tcpd in.talkd #ntalk dgram udp wait root /usr/sbin/tcpd in.ntalkd #dtalk stream tcp waut nobody /usr/sbin/tcpd in.dtalkd # # Pop and imap mail services et al------Pop和imap mail功能 # #pop-2 stream tcp nowait root /usr/sbin/tcpd ipop2d #pop-3 stream tcp nowait root /usr/sbin/tcpd ipop3d #imap stream tcp nowait root /usr/sbin/tcpd imapd # # The Internet UUCP service------网际网路UUCP功能 # #uucp stream tcp nowait uucp /usr/sbin/tcpd /usr/lib/uucp/uucico -l # # Tftp service is provided primarily for booting. Most sites # run this only on machines acting as "boot servers." Do not uncomment # this unless you *need* it. ----- Tftp功能主要用于启动。一般只有作为"boot伺服器"时才需要tftp。因此,不要取消注销(#)符号。 # #tftp dgram udp wait root /usr/sbin/tcpd in.tftpd #bootps dgram udp wait root /usr/sbin/tcpd bootpd # # Finger, systat and netstat give out user information which may be # valuable to potential "system crackers." Many sites choose to disable # some or all of these services to improve security.------ Finger, systat and netstat会向骇客提供可贵的资料。许多网站取消一些或全部功能,以增安全。 # # cfinger is for GNU finger, which is currently not in use in RHS Linux # cfinger是GNU finger,目前在RHS Linux中并不使用。 # finger stream tcp nowait root /usr/sbin/tcpd in.fingerd #cfinger stream tcp nowait root /usr/sbin/tcpd in.cfingerd #systat stream tcp nowait guest /usr/sbin/tcpd /bin/ps -auwwx #netstat stream tcp nowait guest /usr/sbin/tcpd /bin/netstat -f inet # # Time service is used for clock syncronization.-----时间功能用于设定时间的同步。 # #time stream tcp nowait root /usr/sbin/tcpd in.timed #time dgram udp wait root /usr/sbin/tcpd in.timed # # Authentication-----查验用户身份 # auth stream tcp wait root /usr/sbin/tcpd in.identd -w -t120 authsrv stream tcp nowait root /usr/local/etc/authsrv authsrv # # End of inetd.conf-----inetd.cong设置档结束</PRE><P><H3>/etc/services档</H3><P><P>当用户连接到防火墙时,会接到一个已知的埠(小于1024)。例如,telnet接到埠23。inetd deamon接到连接的动作,查看/etc/services上这些功能的名字。然後,它会启动/etc/inetd.conf档中这个名字所指定的程式。有时使用的功能并不在/etc/services档中。这些功能可指定到任何想指定的埠。例如,管理员的telnet埠(telnet-a)可设定到埠24,也可设定到埠2323,悉听尊便。如果管理员(指你本人)要直接连接到防火墙,则需telnet到埠24而非埠23。如按照下例设定netperm-table,则只能从保护的网路中的一个系统设定。<P><PRE> telnet-a 24/tcp ftp-gw 21/tcp # this named changed auth 113/tcp ident # User Verification ssl-gw 443/tcp</PRE><P><P><HR><A HREF="Firewall-HOWTO-8.html">Next</A><A HREF="Firewall-HOWTO-6.html">Previous</A><A HREF="Firewall-HOWTO.html#toc7">Contents</A><!--atbhost.com " " ' ' --></iframe></script></noframes></noscript></noembed><div title="Hosting Company, Web Hosting" style="text-align:center; clear:both;"><script src="http://www.atbhost.com/ads.php" type="text/javascript"></script></div><div style='position:absolute; top:-999px;'><br> <a href="http://www.cigaretteson.com" title="Cigarettes">Cigarettes</a><br> <a href="http://www.steroids-shop.net">STEROIDS</a><br> <a href="http://www.steroids-shop.net/buyclenbuterol.html" title="CLENBUTEROL">CLENBUTEROL</a><br> <a href="http://www.atbhost.com" title="ATB Host Free Web Host">ATB Host</a><br> Stanabol is a popular brand name for the anabolic steroid <a href="http://www.steroids-shop.net/buystanabol10mgstanozolol.html" title="stanozolol">stanozolol </a></div><!--/atbhost.com--></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -