프로그램/리눅스

리눅스 vsftpd ip 접근제한

쭌파 2017. 4. 3. 15:59

# 외부 ip접근 처리

 

0. 필수 사항

  0-1. xinetd 설치 확인

1
[root@cmp ~]# rpm -qa xinetd
cs

 

  0-2. 설치가 되어있지 않다면 yum 으로 설치

1
[root@cmp ~]# yum -y install xinetd
cs

 

1. vsftpd.con 설정

1
2
3
[root@cmp ~]# vi /etc/vsftpd/vsftpd.conf
... 중략 ...
tcp_wrappers=YES
cs

  - tcp_wrappers 가 YES 로 설정 되어있어야 한다.

 

2. hosts.deny 설정

1
2
[root@cmp ~]# vi /etc/hosts.deny
vsftpd:ALL
cs

 

3. hosts.allow 설정

1
2
[root@cmp ~]# vi /etc/hosts.allow
vsftpd:192.168.0.1, 192.168.0.2...
cs

  - 위와같이 허용하고자 하는 IP를 입력한다.

  - 다중설정 예) 192.168.0.1, 192.168.0.2

    콤마(,)로 구분하여 준다.

 

4. 설정 적용

1
2
[root@cmp ~]# service xinetd reload
[root@cmp ~]# service xinetd restart
cs