Search results for 'tcp_wr'

  1. 2007/02/14 -- Tcp Wrapper 설치방법

Tcp Wrapper 설치방법

2007/02/14 12:17

설치 OS : Solaris 8,9

기본 디렉토리 : /usr/local/bin

다운로드 : http://www.sunfreeware.com

1. tcpwrapper 란?

현재에는 방화벽등 각종 보안장비들을 이용하여 서버에 대한 보안을 실시 하고 있다. 더군다나 서버기반에서는 Secure OS를 설치하여 보안에 대응하고 있다. 하지만 금액이 비싸고, 프리웨어중 서버기반하에 실행되는 보안프로그램이 부족한 편이다. 그리하여 예전에 리눅서 버전부터 꾸준한 인기를 얻고 있는 tcpwrapper 에 대해서 알아보려고 합니다.

tcpwrapper는 호스트기반에서 IP를 기준으로 접근 수락 및 제어를 할수 있습니다. tcpwrapper에 영향을 받는 서비스의 목록은 /etc/inetd.conf 파일에 있는 서비스 데몬들이다. 솔라리스 10버젼에는 기본적으로 OS에 포함되어 나오며, 솔라리스 8,9버젼을 아래와 같이 설치를 하시면 됩니다. 


< tcpwrapper 설치 >

1. 패키지를 웹페이지로부터 다운로드 합니다.

  - http://www.sunfreeware.com/


2. FTP를 이용하여 설치하고자 하는 서버에 업로드 합니다.


3. 패키지를 추가합니다

[test:/]pkgadd -d tcp_wrappers*

다음과 같은 패키지를 사용할 수 있습니다.

  1  SMCtcpwr     tcp_wrappers

                  (sparc) 7.6


처리할 패키지(들)를 선택하십시오.(또는 모든 패키지를

처리하려면'all'을 입력하십시오.) (default: all) [?,??,q]: all

패키지 예 <SMCtcpwr>(을)를 </tcp_wrappers-7.6-sol8-sparc-local>에서 처리 중


tcp_wrappers

(sparc) 7.6

Wietse Venema

디렉토리 </usr/local>(을)를 패키지의 기본 디렉토리로 사용

## 패키지 정보 처리 중

## 시스템 정보 처리 중

   6개 패키지 경로 이름이 이미 제대로 설치되어 있습니다.

 

## 디스크 공간 요구 검증 중

## 이미 설치되어 있는 패키지와의 충돌 여부를 확인하고 있습니다.

## setuid/setgid 프로그램 점검

tcp_wrappers(을)를 <SMCtcpwr>(으)로 설치


## 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

[ 클래스 <none> 검증 ]


<SMCtcpwr>(이)가 성공적으로 설치되었습니다.

[test:/]

4. 호스트 파일의 수정

  - hosts.allow 파일을 새로 생성하고 인가하고자 하는 IP만 기록한다.

/etc/hosts.allow

in.telnetd : 192.168.0.1 22.132.2.

in.ftpd : 22.132.2.

 위의 설정파일의 내용은 192.168.0.1을 승인하고 22.132.2.에 해당하는 255대에 대해      서도 접근승인을 하는 설정입니다.

  - hosts.deny 파일을 새로 생성한다. 기본적으로 모든 서비스 거부로 기록한다.

/etc/hosts.deny

ALL:ALL

5. /etc/inetd.conf 의 수정

 - 대개의 경우 telnet, ftp 의 대한 IP 접근 제어를 하려 할것이다. telnet, ftp 부분을 아래와 같이 변경한다.

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

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

shell   stream  tcp     nowait  root    /opt/sbin/tcpd  in.rshd

login   stream  tcp     nowait  root    /opt/sbin/tcpd  in.rlogind

finger  stream  tcp     nowait  nobody  /opt/sbin/tcpd  in.fingerd

위의 설정중 원하는 부분만 수정을 하도록 한다.

6. 설정 파일의 점검

 - tcpdchk : 현재 설정되어 있는 상황을 점검할수 있다.

[root@tgs] tcpdchk -v   

Using network configuration file: /etc/inetd.conf


>>> Rule /etc/hosts.allow line 6:

daemons:  in.telnetd

clients:  192.168.0.1

access:   granted


>>> Rule /etc/hosts.deny line 9:

daemons:  ALL

clients:  ALL

access:   denied

 

- tcpdmatch : 실제로 IP가 접근거부/수락이 어떻게 되는지 테스트한다.

[root@tgs]tcpdmatch in.telnetd 192.168.0.1

client:   address  192.168.0.125

server:   process  in.telnetd

matched:  /etc/hosts.allow line 6

access:   granted

 

192.168.0.125번 IP에서 telnet 접근이 가능함을 볼 수 있다.

7. /etc/inetd.conf 의 재시작

# ps -ef |grep inet

# kill -HUP <inet-PID>

8. 접속에 대한 테스트

  - 보통 hosts.allow 에 등록이 되어 있지 않으면 telnet, ftp를 해도 프롬프트에 대한 응답이 없다.

< Solaris 10 에서의 TCP Wrapper 의 설정 >

1. 현재의 tcpwrapper 의 설정확인

   # inetadm -p

     tcp_wrappers=false

     - 솔라리스 10은 기본적으로 false로 설정되어 있다.


2. 호스트 파일의 수정

  - 위의 4번 사항과 동일하다


3. tcpwrapper 의 시작설정

 # inetadm -M tcp_wrappers=true


4. 설정 파일의 점검

  - 위의 7번항목과 동일하다


5. tcpwrapper 의 중지

# inetadm -M tcp_wrappers=false

크리에이티브 커먼즈 라이선스
Creative Commons License

밴스 컴퓨터 이야기/Solaris sToRy ,