古典 网站模板,cps网站建设,wordpress支付宝扫码支付宝,html教程菜鸟Linux防火墙主要用于控制网络流量#xff0c;保护系统安全。在Linux中#xff0c;有几种不同的防火墙管理工具#xff0c;其中最常见的是iptables和firewalld。本章主要讲述如何关闭防火墙。 操作系统#xff1a;
CentOS Stream 9
操作步骤#xff1a;
关闭防火墙… Linux防火墙主要用于控制网络流量保护系统安全。在Linux中有几种不同的防火墙管理工具其中最常见的是iptables和firewalld。本章主要讲述如何关闭防火墙。 操作系统
CentOS Stream 9
操作步骤
关闭防火墙selinux ,22行 SELINUXdisabled
[rootlocalhost ~]# cat -n /etc/sysconfig/selinux1 2 # This file controls the state of SELinux on the system.3 # SELINUX can take one of these three values:4 # enforcing - SELinux security policy is enforced.5 # permissive - SELinux prints warnings instead of enforcing.6 # disabled - No SELinux policy is loaded.7 # See also:8 # https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/using_selinux/changing-selinux-states-and-modes_using-selinux#changing-selinux-modes-at-boot-time_changing-selinux-states-and-modes9 #10 # NOTE: Up to RHEL 8 release included, SELINUXdisabled would also11 # fully disable SELinux during boot. If you need a system with SELinux12 # fully disabled instead of SELinux running with no policy loaded, you13 # need to pass selinux0 to the kernel command line. You can use grubby14 # to persistently set the bootloader to boot with selinux0:15 #16 # grubby --update-kernel ALL --args selinux017 #18 # To revert back to SELinux enabled:19 #20 # grubby --update-kernel ALL --remove-args selinux21 #22 SELINUXdisabled 此处注意23 # SELINUXTYPE can take one of these three values:24 # targeted - Targeted processes are protected,25 # minimum - Modification of targeted policy. Only selected processes are protected.26 # mls - Multi Level Security protection.27 SELINUXTYPEtargeted28
29
[rootlocalhost ~]# cat -n /etc/selinux/config1 2 # This file controls the state of SELinux on the system.3 # SELINUX can take one of these three values:4 # enforcing - SELinux security policy is enforced.5 # permissive - SELinux prints warnings instead of enforcing.6 # disabled - No SELinux policy is loaded.7 # See also:8 # https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/using_selinux/changing-selinux-states-and-modes_using-selinux#changing-selinux-modes-at-boot-time_changing-selinux-states-and-modes9 #10 # NOTE: Up to RHEL 8 release included, SELINUXdisabled would also11 # fully disable SELinux during boot. If you need a system with SELinux12 # fully disabled instead of SELinux running with no policy loaded, you13 # need to pass selinux0 to the kernel command line. You can use grubby14 # to persistently set the bootloader to boot with selinux0:15 #16 # grubby --update-kernel ALL --args selinux017 #18 # To revert back to SELinux enabled:19 #20 # grubby --update-kernel ALL --remove-args selinux21 #22 SELINUXdisabled #注意23 # SELINUXTYPE can take one of these three values:24 # targeted - Targeted processes are protected,25 # minimum - Modification of targeted policy. Only selected processes are protected.26 # mls - Multi Level Security protection.27 SELINUXTYPEtargeted28
29
firewalld
[rootlocalhost ~]# systemctl disable firewalld
[rootlocalhost ~]#
[rootlocalhost ~]#
[rootlocalhost ~]#
[rootlocalhost ~]# systemctl stop firewalld
[rootlocalhost ~]#
重启服务器
[rootlocalhost ~]#reboot
查询防火墙是否关闭
[rootlocalhost ~]# sestatus
SELinux status: disabled
[rootlocalhost ~]# systemctl status firewalld
○ firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; preset: Active: inactive (dead)Docs: man:firewalld(1)
[rootlocalhost ~]# iptables -vnL
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)pkts bytes target prot opt in out source destination Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)pkts bytes target prot opt in out source destination
[rootlocalhost ~]#