当前位置: 首页 > news >正文

Linux防火墙配置001

        Linux防火墙主要用于控制网络流量,保护系统安全。在Linux中,有几种不同的防火墙管理工具,其中最常见的是iptablesfirewalld。本章主要讲述如何关闭防火墙。

操作系统:

CentOS Stream 9

操作步骤:

关闭防火墙,selinux  ,22行    SELINUX=disabled   

​
[root@localhost ~]# 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, SELINUX=disabled 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 selinux=0 to the kernel command line. You can use grubby14	# to persistently set the bootloader to boot with selinux=0:15	#16	#    grubby --update-kernel ALL --args selinux=017	#18	# To revert back to SELinux enabled:19	#20	#    grubby --update-kernel ALL --remove-args selinux21	#22	SELINUX=disabled    此处注意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	SELINUXTYPE=targeted28	
29	
​
[root@localhost ~]# 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, SELINUX=disabled 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 selinux=0 to the kernel command line. You can use grubby14	# to persistently set the bootloader to boot with selinux=0:15	#16	#    grubby --update-kernel ALL --args selinux=017	#18	# To revert back to SELinux enabled:19	#20	#    grubby --update-kernel ALL --remove-args selinux21	#22	SELINUX=disabled    #注意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	SELINUXTYPE=targeted28	
29	​​​

firewalld

[root@localhost ~]# systemctl disable firewalld
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# 

重启服务器

[root@localhost ~]#reboot

查询防火墙是否关闭

[root@localhost ~]# sestatus
SELinux status:                 disabled
[root@localhost ~]# 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)
[root@localhost ~]# 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         
[root@localhost ~]# 

http://www.lryc.cn/news/367132.html

相关文章:

  • Tomcat概述及部署
  • [Vue3:Vite构建项目]:安装router实现登录页面路由跳转
  • 概率论与数理统计,重要知识点——全部公式总结
  • Spring系列-SpringMvc父子容器启动原理解析
  • [ssi-uploader插件]解决如何接收服务器返回数据+修改参数名称
  • InfiniGate自研网关实现思路七
  • 277 基于MATLAB GUI火灾检测系统
  • 【西瓜书】4.决策树
  • 区块链--Ubuntu上搭建以太坊私有链
  • 菜品信息分页查询——后端SpringBoot
  • 利用GPT和PlantUML快速生成UML图用于设计
  • web-上传项目文件夹到Git远程仓库
  • 使用OpenPCDet训练与测试Transformer模型:如何加载自己的数据集
  • 四舍五入问题
  • 零基础入门学用Arduino 第一部分(三)
  • C++标准库random
  • 电子电气架构——车载诊断DTC一文通
  • Golang | Leetcode Golang题解之第129题求根节点到叶节点数字之和
  • 工业信息化SCI期刊,中科院1区TOP,IF=12.3,收稿范围广泛
  • Spring Boot整合Redis
  • kafka的leader和follower
  • git 空仓库笔记
  • 字母异位词分组(charyw)
  • 力扣 41.缺少的第一个正整数
  • Git从入门到放弃
  • 003.数据分析_PandasSeries对象
  • 【介绍下什么是Kubernetes编排系统】
  • linux防止nmap扫描
  • 基于SpringBoot的装饰工程管理系统源码数据库
  • 2024前端面试准备2-JS基础知识回顾