Vsftpd 與TCP_wrapper 結(jié)合
Vsftpd 與TCP_wrapper 結(jié)合
若是讀者希望直接在/etc/hosts.allow 之中定義允許或是拒絕的來源地址,可執(zhí)行以下步驟。這是簡易的防火墻設(shè)定。
Step1. 確定/etc/vsftpd/vsftpd.conf 之中tcp_wrappers 的設(shè)定為YES,
- tcp_wrappers=YES
這是RedHat9 的默認值,基本上不需修改。
Step2. 重新啟動vsftpd
- [root@home vsftpd]# /sbin/service vsftpd restart
- Shutting down vsftpd: OK ]
- Starting vsftpd for vsftpd: OK ]
Step3. 設(shè)定/etc/hosts.allow,譬如提供111.22.33.4 以及10.1.1.1 到10.1.1.254 連線,則可做下圖之設(shè)定:
- vsftpd : 111.22.33.4 10.1.1. : allow
ALL : ALL : DENY
8.2.12. 將vsftpd 并入XINETD
若是讀者希望將vsftpd 并入XINETD 之中,也就是7.x 版的預(yù)設(shè)設(shè)定,那
么讀者可以執(zhí)行以下步驟。
Step1. 修改/etc/vsftpd/vsftpd.conf
將
- listen=YES
改為
- listen=NO
Step2. 新增一個檔案: /etc/xinetd.d/vsftpd
內(nèi)容如下:
- service vsftpd
- {
- disable = no
- socket_type = stream
- wait = no
- user = root
- server = /usr/sbin/vsftpd
- port = 21
- log_on_success += PID HOST DURATION
- log_on_failure += HOST
- }
Step3. 重新啟動xinetd
- [root@home vsftpd]# /sbin/service xinetd restart
- Stopping xinetd: OK ]
- Starting xinetd: OK ]
【編輯推薦】