用FWTK配置Linux防火墙

http://tech.ddvip.com   2006年04月03日    社区交流 收藏本文

本文详细介绍用FWTK配置Linux防火墙

  tn-gw 3333/tcp

  2.配置/etc/inetd.conf。将通常的telnet端口移至3333,telnet代理在23号端口监听(用高端口保护正常telent服务,netacl是FWTK提供的TCP包装程序,功能和tcpd相似):

  telnet stream tcp nowait root /usr/local/etc/tn-gw tn-gw

  tn-gw stream tcp nowait root /usr/local/etc/netacl in.telnetd

  执行命令killall -HUP inetd使改动生效。

  3.配置/usr/local/etc/netperm-table(其中.txt文件的内容由自己编写,但一定要保证和directory的路径一致):

  ● 控制登录防火墙主机(正常telnet)部分:

  #允许本地登录

  netacl-in.telnetd: permit-hosts 127.0.0.1 -exec /usr/sbin/in.telnetd

  #只允许10.1.1.5远程登录到防火墙

  netacl-in.telnetd: permit-hosts 10.1.1.5 -exec /usr/sbin/in.telnetd

  #显示不允许登录时的拒绝信息

  netacl-in.telnetd: permit-hosts * -exec /bin/cat /home/guest/notelnet.txt

  netacl-in.telnetd: timeout 300 #超时设置

  ● 控制通过防火墙主机(telnet代理)部分(最好在/etc/passwd中将guest的/bin/bash改成/bin/false):

  #认证服务器IP和端口号

  tn-gw: authserver 127.0.0.1 7777

  tn-gw: directory /home/guest #工作目录

  tn-gw: groupid guest #工作组名

  tn-gw: userid guest #工作用户名

  # 欢迎信息

  tn-gw: welcome-msg tn-welcome.txt

  # 对拒绝访问者的信息

  tn-gw: denial-msg tn-deny.txt

  # 对受限目的拒绝访问者的信息

  tn-gw: denydest-msg tn-denydest.txt

  tn-gw: help-msg tn-help.txt # 帮助信息

  tn-gw: timeout 300 # 设定超时的时间

  tn-gw: prompt tn-gw-> # 提示符

  # 允许10.1.1.*机器登录

  tn-gw: permit-hosts 10.1.1.* -dest * -passok

  # 允许192.9.200.*机器登录,但要求进行身份认证

  tn-gw: permit-hosts 192.9.200.* -dest 10.1.1.* -auth

  4.配置认证服务器

  ● 配置/etc/services,给authsrv增加端口号:

  authsrv 7777/tcp

  ● 配置/etc/inetd.conf,以inted进程启动authsrv:

  authsrv stream tcp nowait root /usr/local/etc/authsrv authsrv

  执行killall -HUP inetd使改动生效。

  5.配置netperm-table:

  #允许防火墙主机使用认证服务器

  authsrv: hosts 127.0.0.1

  #数据库所在路径

  authsrv: database /usr/local/etc/fw-authdb

  authsrv: directory /home/guest #工作目录

  authsrv: groupid guest #工作组名

  authsrv: userid guest #工作用户名

  authsrv: badsleep 1200 #禁止尝试注册的时间

  authsrv: timeout 300 #超时设置

  authsrv: nobogus true #允许注册失败响应

  依据以上步骤,同样可以高效地配置FTP代理(ftp-gw)、邮件代理(smap)、HTTP代理(http-gw)、pop3代理(plug-gw)。

责编:豆豆技术应用

正在加载评论...