Selinux的基本使用

Selinux基本使用

Table of Contents

  • 1. selinux管理命令
  • 2. 查看端口
  • 3. 允许及禁用端口

1 selinux管理命令

selinux 的管理 命令是semanage. 提供该命令的是 policycoreutils-python. 执行下面命令安装:

yum install -y policycoreutils-python

2 查看端口

semanage port -l

3 允许及禁用端口

# 开放端口
semanage port -a -t http_port_t -p tcp 5002
# 禁用端口
semanage port -d -t http_port_t -p tcp 5002

-a : allow -d : deny

有了selinux,对于端口的管理会更加严格。我们可以通过selinux 将常用的默认端口全部禁用。

Author: halberd.lee

Created: 2020-06-08 Mon 23:59

Validate

你可能感兴趣的:(Selinux的基本使用)