Linux初始配置 -- 防火墙和Selinux配置

Linux初始配置 – 防火墙和Selinux配置


title: Firewall和Selinux配置
categories:

  • Linux
  • Centos
  • Centos 7
  • Initial Settings
    tags:
  • linux
  • centos
  • initial settings
  • firewall
  • selinux
    abbrlink: 14172
    date: 2020-04-22 15:00:13

Linux初始配置 -- 防火墙和Selinux配置_第1张图片
Part A: Firewall

  1. It’s possible to show Service Status of FireWall like follows. (enabled by default)
[root@dlp ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: active (running) since Thu 2015-03-31 19:36:27 JST; 2s ago
 Main PID: 1308 (firewalld)
   CGroup: /system.slice/firewalld.service
           └─1308 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid
.....
.....
  1. If you use FireWall service, it needs to modify settings of it because incoming requests for services are mostly not allowed by default. Refer to here to basic operation and settings to configure firewalld service.
  2. If FireWall service does not need for you because of some reasons like that some FireWall Machines are running in your Local Netowrk or others, it’s possbile to stop and disable it like follows.
# stop service
[root@dlp ~]# systemctl stop firewalld
# disable service
[root@dlp ~]# systemctl disable firewalld
rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
rm '/etc/systemd/system/basic.target.wants/firewalld.service'

Part B: Selinux

  1. It’s possible to show Status of SELinux (Security-Enhanced Linux) like follows. (enabled by default)
  2. If SELinux function does not need for you because of some reasons like that your server is running only in Local safety Network or others, it’s possbile to disable it like follows.
[root@dlp ~]# vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled   # change to disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

# restart to apply new setting
[root@dlp ~]# reboot

你可能感兴趣的:(Linux,selinux,linux,iptables)