晚上空闲!!tcpwapper一点点使用心得Unix系统 -电脑资料

电脑资料 时间:2019-01-01 我要投稿
【www.unjs.com - 电脑资料】

    1.下载tcp_wrapper 下载网站www.sunfreeware.com tcp_wrappers-7.6-sol8-sparc-local.gz 2.安装tcp_wrapper a.解压缩 #gunziptcp_wrappers-7.6-sol8-sparc-local.gz b.安装 #pkgadd–dtcp* 注意:如果要支持IPV6则要下载tcp_wrappers_ipv6-7.6-sol8-sparc-l

    1.下载tcp_wrapper

    下载网站  www.sunfreeware.com

    tcp_wrappers-7.6-sol8-sparc-local.gz

    2.安装tcp_wrapper

    a.解压缩

    #gunzip tcp_wrappers-7.6-sol8-sparc-local.gz

    b.安装

    #pkgadd –d tcp*

    注意:如果要支持IPV6则要下载tcp_wrappers_ipv6-7.6-sol8-sparc-local.gz代替

    3.设置tcp_wrapper

    基于服务的设置

    a. 设定/etc/inet/inetd.conf

    ftp stream tcp nowait root /usr/sbin/in.ftpd in.ftpd

    改成

    ftp stream tcp nowait root /usr/local/bin/tcpd in.ftpd

    telnet stream tcp nowait root /usr/sbin/in.telnetd  in.telnetd

    改成

    telnet stream tcp nowait root /usr/local/bin/tcpd  in.telnetd

    注意:把tcp6要改为tcp

    b.设置/etc/hosts.allow

    in.telnetd:202.66.202.:ALLOW

    in.ftpd:202.66.202.:ALLOW

    c.设置/etc/hosts.deny

    in.telnetd:ALLENY

    in.ftpd:ALLENY

    d. /etc/hosts

    ( 加入授权使用的 ip Address 和主机名称 

    4.重新启动 inetd Daemon

    # /etc/init.d/inetsvc stop

    # /etc/init.d/inetsvc start

    基于IP策略的设置

    1.Tcp_Wrappers

    在默认情况下,Solaris允许所有的服务请求,

晚上空闲!!tcpwapper一点点使用心得Unix系统

。用Tcp_Wrappers来保护服务器安全,使其免受外部的攻击,比想像的要简单和轻松的多。

    在/etc/hosts.deny 文件中加入 ALL:ALL以禁止所有计算机访问服务器,然后在/etc/hosts.allow 文件中加入允许访问服务器的计算机,

电脑资料

晚上空闲!!tcpwapper一点点使用心得Unix系统》(https://www.unjs.com)。这种做法是最安全的。

    Tcp_Wrappers是由两个文件控制的,它们是/etc/hosts.allow 和 /etc/hosts.deny。

    2.设置

    a.编辑/etc/hosts.deny 文件

    # vi /etc/hosts.deny

    加入下面这些行:

    ALL:ALL

    这样做的目的是:所有的服务、访问位置,如果没有被明确的允许,也就是在/etc/hosts.allow 中找不到匹配的项,就是被禁止的。

    b. 编辑/etc/hosts.allow 文件

    # vi /etc/hosts.allow

    例:我们只希望允许同一个局域网的机器使用服务器的telnet功能,而禁止互联网上面的telnet服务请求,本地局域网由 202.39.154. 、202.39.153. 和202.39.152. 三个网段组成。在hosts.deny文件中,我们定义禁止所有机器请求所有服务: ALL:ALL。 在hosts.allow文件中,我们定义只允许局域网访问telnet功能:

    in.telnetd: 202.39.154. 202.39.153. 202.39.152.

    这样,当非局域网的机器请求telnet服务时,就会被拒绝。而局域网的机器可以使用telnet服务。

    如果我们要设置IP为218.1.64.112 和IP在10.10.10网段中的机器可以访问,其他的IP被拒绝则做如下设置。

    a.设置/etc/hosts.allow

    all:218.1.64.112 218.1.2 10.10.10

    b.设置/etc/hosts.deny

    all:all

    附加: 禁止所有不需要的服务

    用grep -v “^#”/etc/inetd.conf命令来察看你当前没有注释的服务

    # vi /etc/inetd.conf

    在/etc/inetd.conf中注释掉左右不需要的服务,比如:

    name、shell、login、exec、comsat、talk、rusersd、printer、finger、uucp 所有以“r”开头的服务,对必须提供的服务采用tcpwapper来保护。

    [b:fd5dc9ff1e]注意:[/b:fd5dc9ff1e]后面的部分是照抄RACE的........

    hutao 回复于:2003-02-14 10:11:30好冬冬啊

    NUG 回复于:2003-03-04 09:54:20有没有多点的啊?

    太少拉。。

    x3y4z5 回复于:2003-03-04 10:56:49looks so good.

    随意江湖行 回复于:2003-03-04 15:44:00好啊!

    真是不错。我正愁怎么保证tcp服务的安全呢!

    多谢了!

    蓝冰 回复于:2003-03-04 16:08:27灌得好

   

    原文转自:http://www.ltesting.net

最新文章