Linux下防火墙和selinux的启动、关闭和查看
发表于:2025-02-03 作者:千家信息网编辑
千家信息网最后更新 2025年02月03日,CentOS7.X下:1.防火墙防火墙状态查看:[root@localhost sunan]# systemctl status firewalld.service● firewalld.servic
千家信息网最后更新 2025年02月03日Linux下防火墙和selinux的启动、关闭和查看
CentOS7.X下:
1.防火墙
防火墙状态查看:
[root@localhost sunan]# systemctl status firewalld.service● firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled) Active: inactive (dead) Docs: man:firewalld(1)
其中Active为inactive (dead)为关闭状态,active (running)为开启状态
关闭防火墙命令:
[root@localhost sunan]# systemctl stop firewalld.service
开启防火墙命令:
[root@localhost sunan]# systemctl start firewalld.service
永久禁用防火墙命令(开机不自启动)
[root@localhost sunan]# systemctl disable firewalld.serviceRemoved symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
永久启动防火墙命令(开机自启动)
[root@localhost sunan]# systemctl enable firewalld.service Created symlink from /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service to /usr/lib/systemd/system/firewalld.service.Created symlink from /etc/systemd/system/multi-user.target.wants/firewalld.service to /usr/lib/systemd/system/firewalld.service.
CentOS6.X下:
1.防火墙
防火墙状态查看:
[root@localhost ~]# service iptables status
关闭防火墙命令:
[root@localhost ~]# service iptables stopiptables: Setting chains to policy ACCEPT: filter [ OK ]iptables: Flushing firewall rules: [ OK ]iptables: Unloading modules: [ OK ]
开启防火墙命令:
[root@localhost ~]# service iptables startiptables: Applying firewall rules: [ OK ]
永久禁用防火墙命令(开机不自启动)
[root@localhost ~]# chkconfig iptables off
永久启动防火墙命令(开机自启动)
[root@localhost ~]# chkconfig iptables on
2.selinux(CentOS7.X同CentOS6.X)
查看selinux状态:
[root@localhost sunan]# getenforce Enforcing
selinux状态有三种模式:
enforcing:强制模式,代表selinux运行中,且已经正确的开始限制domain/type了。
permissive:宽容模式,代表selinux运作中,不过仅会有警告信息并不会实际限制domain/type的访问。这种模式可以用来作为selinux的debug之用
disabled:关闭,selinux没有实际运行。
命令设置SELinux,前提不能是disabled状态:
[root@localhost ~]# setenforce 0[root@localhost ~]# getenforce Permissive
其中setenforce 0|1
0:设置为premissive状态;
1:设置为enforcing状态;
此设置:重启系统后无效。
修改配置文件,设置selinux为disabled状态:
[root@localhost ~]# vim /etc/selinux/configSELINUX=disabledSELINUXTYPE=targeted
保存,重启系统生效。
防火墙
防火
状态
命令
模式
永久
代表
实际
系统
运行
限制
信息
前提
文件
之用
强制
运作
配置
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
泛亚软件开发
access 数据库查询
楼中楼数据库设计
银行软件开发中心和理财子公司
佳豪网络安全
吉林网络技术服务咨询报价
亚马逊的服务器怎么登录
网络安全隐患100个安全隐患
网络技术与应用课程的作用
前端数据库开发面试题
二台电脑之间传数据库
维护网络安全的话
南京计算机网络技术
安徽6端口网络安全硬件设备厂家
网络安全维护实习小结
洛克王国服务器怎么打开
基于酒精检测仪软件开发
网络安全售前好干吗
数据库dos命令
知网数据库怎么更新
f11开启服务器
魔兽tbc 服务器人数在哪里查
民政网络安全宣传简报
评价数据库medline
黄冈新征途软件开发有限公司
超级动物大逃杀服务器在哪
网络安全技术产品
找有偿软件开发项目
为什么有软件开发外包
桓台erp软件开发公司