- 论坛徽章:
- 0
|
简单的介绍tcp wrappers在solaris9下的安装及设置。等有了详细的资料后再来补充
安装非常简单,去Sunfreeware.com上下载相应的软件包。
(注意该包只支持IPv4,想支持IPv6就去下载tcp_wrappers-ipv6-7.6-sol9-sparc-local.gz)
# gzip -d tcp_wrappers-7.6-sol9-sparc-local.gz
# pkgadd -d tcp_wrappers-7.6-sol9-sparc-local
程序安装到/usr/local文件夹下了。
(1) 在/etc/inetd.conf中修改如下:
telnet stream tcp6 nowait root /usr/sbin/in.telnetd in.telnetd
替换为
telnet stream tcp nowait root /usr/local/bin/tcpd in.telnetd
ftp stream tcp6 nowait root /usr/sbin/in.ftpd in.ftpd -a
替换为
ftp stream tcp nowait root /usr/local/bin/tcpd in.ftpd -a
[color="#ff0000"](注意此处把tcp6改为了tcp,因为装的tcp_wrappers的版本不支持ipv6协议)
更改完inetd.conf后一定要重启inetd进程
# /etc/init.d/inetsvc stop
# /etc/init.d/inetsvc start
(2) 配置 /etc/hosts.allow /etc/hosts.deny这两个文件。这两个文件修改后不用重启inetd进程。
优先级: hosts.allow > hosts.deny
# vi /etc/hosts.allow
in.telnetd:192.168.:ALLOW -->表示允许192.168整个B网段的IP访问in.telnetd进程。
in.ftpd:192.168.:ALLOW -->表示允许192.168整个B网段的IP访问in.ftpd进程。
[color="#0000ff"]sshd:192.168.:ALLOW --->后来又增加了sshd登录的控制
# vi /etc/hosts.deny
in.telnetd:ALL:DENY
in.ftpd:ALL:DENY
[color="#0000ff"]sshd:ALL:DENY --->后来又增加了sshd登录的控制
使用tcp wrappers自带的检查工具检查设置情况。
$ tcpdchk -v
Using network configuration file: /etc/inet/inetd.conf
>>> Rule /etc/hosts.allow line 1:
daemons: in.telnetd
clients: 192.168.
option: ALLOW
access: granted
>>> Rule /etc/hosts.allow line 2:
daemons: in.ftpd
clients: 192.168.
option: ALLOW
access: granted
>>> Rule /etc/hosts.deny line 1:
daemons: in.telnetd
clients: ALL
option: DENY
access: denied
>>> Rule /etc/hosts.deny line 2:
daemons: in.ftpd
clients: ALL
option: DENY
access: denied
对设置做一下测试:
$ tcpdmatch in.telnetd 192.168.2.33
client: address 192.168.2.33
server: process in.telnetd
matched: /etc/hosts.allow line 1
option: ALLOW
access: granted
$ tcpdmatch in.telnetd 192.168.1.23
client: address 192.168.1.23
server: process in.telnetd
matched: /etc/hosts.allow line 1
option: ALLOW
access: granted
$ tcpdmatch in.telnetd 211.167.236.4
client: address 211.167.236.4
server: process in.telnetd
matched: /etc/hosts.deny line 1
option: DENY
access: denied
$ tcpdmatch in.telnetd 211.167.236.33
client: address 211.167.236.33
server: process in.telnetd
matched: /etc/hosts.deny line 1
option: DENY
access: denied
$ tcpdmatch in.telnetd 192.12.34.56
client: address 192.12.34.56
server: process in.telnetd
matched: /etc/hosts.deny line 1
option: DENY
access: denied
经过检查
下面是安装过程
# pkgadd -d tcp_wrappers-7.6-sol9-sparc-local
下列软件包是可以使用的:
1 SMCtcpdwr tcp_wrappers
(sparc) 7.6
选择你要执行的软件包(或选择'全部'执行所有的软件包). (default: all) [?,??,q]:
处理软件包范例来自
tcp_wrappers
(sparc) 7.6
Wietse Venema
所选择的基本目录必须存在于开始安装之前
您要现在就创建这个目录吗 [y,n,?,q] y
使用作为包的基本目录
## 正在处理软件包信息.
## 正在处理系统信息.
## 检查磁盘空间需求
## 检查同已经安装的软件包之间的冲突.
## 检查setuid/setgid程序。
安装tcp_wrappers成为
##正在安装1部分- 1.
/usr/local/bin/safe_finger
/usr/local/bin/tcpd
/usr/local/bin/tcpdchk
/usr/local/bin/tcpdmatch
/usr/local/bin/try-from
/usr/local/doc/tcp_wrappers/BLURB
/usr/local/doc/tcp_wrappers/Banners.Makefile
/usr/local/doc/tcp_wrappers/CHANGES
/usr/local/doc/tcp_wrappers/DISCLAIMER
/usr/local/doc/tcp_wrappers/Makefile
/usr/local/doc/tcp_wrappers/README
/usr/local/doc/tcp_wrappers/README.IRIX
/usr/local/doc/tcp_wrappers/README.NIS
/usr/local/include/tcpd.h
/usr/local/lib/libwrap.a
/usr/local/man/man3/hosts_access.3
/usr/local/man/man5/hosts_access.5
/usr/local/man/man5/hosts_options.5
/usr/local/man/man8/tcpd.8
/usr/local/man/man8/tcpdchk.8
/usr/local/man/man8/tcpdmatch.8
[ 确认类别 ]
安装成功
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/7635/showart_60365.html |
|