文档

出错提示“TCP Wrappers configuration affects”

更新时间:

本文主要介绍在Linux操作系统迁移时,迁移任务出错提示“TCP Wrappers configuration affects”信息时的问题描述、问题原因及其解决方案。

问题描述

在SMC操作系统迁移到AnolisOS时,迁移任务出错提示“TCP Wrappers configuration affects”信息。

问题原因

Anolis OS 8不再支持TCP Wrapper。

解决方案

TCP Wrappers是一种在应用程序级别阻止传入连接的简单工具。 最早在Linux中还没有防火墙,现在可以使用firewalld来替代TCP Wrappers。

以TCP Wrappers 限制ssh策略为例,将TCP Wrappers限制转换成firewalld配置的方式。

  • 假设 /etc/hosts.deny的配置为:

    #
    # hosts.deny	This file contains access rules which are used to
    #		deny connections to network services that either use
    #		the tcp_wrappers library or that have been
    #		started through a tcp_wrappers-enabled xinetd.
    #
    #		The rules in this file can also be set up in
    #		/etc/hosts.allow with a 'deny' option instead.
    #
    #		See 'man 5 hosts_options' and 'man 5 hosts_access'
    #		for information on rule syntax.
    #		See 'man tcpd' for information on tcp_wrappers
    #
    sshd: ALL
  • 假设/etc/hosts.allow的配置为:

    #
    # hosts.allow This file contains access rules which are used to
    # allow or deny connections to network services that
    # either use the tcp_wrappers library or that have been
    # started through a tcp_wrappers-enabled xinetd.
    #
    # See ‘man 5 hosts_options’ and ‘man 5 hosts_access’
    # for information on rule syntax.
    # See ‘man tcpd’ for information on tcp_wrappers
    #
    sshd: 192.168.20.100 192.168.20.101 
    sshd: 192.168.15.16/29
  1. 远程连接源服务器。具体操作,请参见连接实例

  2. 执行以下命令,安装firewalld并启动服务。

    yum install -y firewalld
    systemctl enable firewalld
    systemctl restart firewalld
  3. 执行以下命令,把ssh在firewalld的default zone移除。

    firewalld在default zone(public zone)里面默认使能了ssh。

    firewall-cmd --permanent --remove-service=ssh
  4. 执行以下命令,创建一个新的firewalld zone。

    firewall-cmd --permanent --new-zone=sshzone
  5. 执行以下命令,把ssh服务和网络过滤条件加到sshzone中。

    firewall-cmd --permanent --zone=sshzone --add-source=192.168.20.100
    firewall-cmd --permanent --zone=sshzone --add-source=192.168.20.101
    firewall-cmd --permanent --zone=sshzone --add-source=192.168.15.16/29
    firewall-cmd --permanent --zone=sshzone --add-service=ssh
  6. 执行以下命令,加载配置。

    firewall-cmd --reload
  7. 注释掉/etc/hosts.allow/etc/hosts.deny里面的内容。

  8. 问题排查解决后,运行SMC客户端再试。具体操作,请参见运行SMC客户端

  • 本页导读 (1)
文档反馈