关闭防火墙

  1. 1、临时关闭(下次开机启动,自动启动防火墙)
  2. [root@localhost ~]# systemctl stop firewalld
  3. 2、查看防火墙状态
  4. [root@localhost ~]# systemctl status firewalld
  5. 3、永久关闭防火墙(开机启动时不在启动)
  6. [root@localhost ~]# systemctl disable firewalld

关闭SElinux

  1. 1、查看selinux状态
  2. [root@localhost ~]# getenforce
  3. Enforcing 表示启动
  4. 2、临时关闭
  5. [root@localhost ~]# setenforce
  6. usage: setenforce [ Enforcing | Permissive | 1 | 0 ] 1表示启动,0表示关闭
  7. [root@localhost ~]# setenforce 0 临时关闭
  8. [root@localhost ~]# getenforce 查看状态
  9. Permissive 关闭状态
  10. 3、永久关闭(修改配置文件,即可永久关闭)
  11. [root@localhost ~]# vi /etc/selinux/config
  12. # This file controls the state of SELinux on the system.
  13. # SELINUX= can take one of these three values:
  14. # enforcing - SELinux security policy is enforced.
  15. # permissive - SELinux prints warnings instead of enforcing.
  16. # disabled - No SELinux policy is loaded.
  17. SELINUX=enforcing 修改为"SELINUX=disabled"
  18. # SELINUXTYPE= can take one of three values:
  19. # targeted - Targeted processes are protected,
  20. # minimum - Modification of targeted policy. Only selected processes are protected.
  21. # mls - Multi Level Security protection.
  22. SELINUXTYPE=targeted