首页 运维 正文
Vsftpd 与TCP_wrapper 结合

 2022-10-23    378  

  Vsftpd TCP_wrapper 结合

  若是读者希望直接在/etc/hosts.allow 之中定义允许或是拒绝的来源地址,可执行以下步骤。这是简易的防火墙设定。

Vsftpd 与TCP_wrapper 结合

  Step1. 确定/etc/vsftpd/vsftpd.conf 之中tcp_wrappers 的设定为YES,

  tcp_wrappers=YES
  •   这是RedHat9 的默认值,基本上不需修改。

      Step2. 重新启动vsftpd

      [root@homevsftpd]#/sbin/servicevsftpdrestart 
  •   Shuttingdownvsftpd:OK]
  •   Startingvsftpdforvsftpd:OK]
  •   Step3. 设定/etc/hosts.allow,譬如提供111.22.33.4 以及10.1.1.1 到10.1.1.254 连线,则可做下图之设定:

      vsftpd:111.22.33.410.1.1.:allow 
  •   ALL : ALL : DENY

      8.2.12. 将vsftpd 并入XINETD

      若是读者希望将vsftpd 并入XINETD 之中,也就是7.x 版的预设设定,那

      么读者可以执行以下步骤。

      Step1. 修改/etc/vsftpd/vsftpd.conf

      将

      listen=YES
  •   改为

      listen=NO
  •   Step2. 新增一个档案: /etc/xinetd.d/vsftpd

      内容如下:

      servicevsftpd 
  •   {
  •   disable=no
  •   socket_type=stream
  •   wait=no
  •   user=root
  •   server=/usr/sbin/vsftpd
  •   port=21
  •   log_on_success+=PIDHOSTDURATION
  •   log_on_failure+=HOST
  •   }
  •   Step3. 重新启动xinetd

      [root@homevsftpd]#/sbin/servicexinetdrestart 
  •   Stoppingxinetd:OK] 
  •   Startingxinetd:OK]
  • 原文链接:https://77isp.com/post/8494.html

    =========================================

    https://77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。