'xinetd'에 해당되는 글 1건

  1. 2008.06.27 /etc/hosts.allow , /etc/hosts.deny
2008. 6. 27. 00:25

/etc/hosts.allow , /etc/hosts.deny

linux - TCP 데몬 xinetd에 의한 접속 제어

tcpd는 특정 IP나 도메인으로부터 서버로의 telnet, ftp, pop 등의 접속을 차단, 접속/시도에 대한 기록을 특정한 파일에 로그로 기록한다.

xinetd는 tcp-wrapper 을 내장하고 있기 때문에 xinetd모드에서 실행 되는 서비스들은 거의 대부분
tcpd라는 tcp_wrapper의 데몬에 의해 접속 제어를 받게 된다.

쉽게 말해서 /etc/hosts.deny       와 /etc/hosts.allow   파일로 제어 된다.

tcpd  - /etc/hosts.allow    : 접속 허용
          /etc/hosts.deny     : 접속 거부
특징       :        allow와 deny 에 없는 것은 default 로 접속 허용이 되기 때문에 모두 차단으로 변경하는것이
                      좋다.
# vi /etc/hosts.deny
-----------------------------------------------------------------------------------
# hosts.deny    This file describes the names of the hosts which are
#               *not* allowed to use the local INET services, as decided
#               by the '/usr/sbin/tcpd' server.
#
# The portmap line is redundant, but it is left to remind you that
# the new secure portmap uses hosts.deny and hosts.allow.  In particular
# you should know that NFS uses portmap!

#ex)ALL:ALL
#ex) sshd: 192.168.0.100/24  : twist /bin/echo "ACCESS DENIED!"
-----------------------------------------------------------------------------------

ex)의 예제처럼 작성하면 된다. #은 주석 처리이다.