Linux下防火墙和selinux的启动、关闭和查看
发布时间:2020-12-14 00:26:39 所属栏目:Linux 来源:网络整理
导读:CentOS7.X下: 1.防火墙 防火墙状态查看: [[email?protected] sunan]# systemctl status firewalld.service● firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor pre
CentOS7.X下:
1.防火墙防火墙状态查看:[[email?protected] 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)为开启状态 关闭防火墙命令:[[email?protected] sunan]# systemctl stop firewalld.service 开启防火墙命令:[[email?protected] sunan]# systemctl start firewalld.service 永久禁用防火墙命令(开机不自启动)[[email?protected] sunan]# systemctl disable firewalld.service Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service. Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service. 永久启动防火墙命令(开机自启动)[[email?protected] 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.防火墙防火墙状态查看:[[email?protected] ~]# service iptables status 关闭防火墙命令:[[email?protected] ~]# service iptables stop iptables: Setting chains to policy ACCEPT: filter [ OK ] iptables: Flushing firewall rules: [ OK ] iptables: Unloading modules: [ OK ] 开启防火墙命令:[[email?protected] ~]# service iptables start iptables: Applying firewall rules: [ OK ] 永久禁用防火墙命令(开机不自启动)[[email?protected] ~]# chkconfig iptables off 永久启动防火墙命令(开机自启动)[[email?protected] ~]# chkconfig iptables on 2.selinux(CentOS7.X同CentOS6.X)查看selinux状态:[[email?protected] sunan]# getenforce Enforcing selinux状态有三种模式: [[email?protected] ~]# setenforce 0 [[email?protected] ~]# getenforce Permissive 其中setenforce 0|1 [[email?protected] ~]# vim /etc/selinux/config SELINUX=disabled SELINUXTYPE=targeted 保存,重启系统生效。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- Linux Setup Creator [暂停]
- Fast portable non-blocking network programming with Lib
- linux – 如何在CentOS重启时自动启动MongoDB?
- linux – Java进程(OpenDS)消耗所有cpu(futex flood) – 如
- linux – 如何在RHEL 6.4 Server中配置绑定桥接器?
- gpg – 如何将Duplicity与对称密钥一起使用?
- rsync – 前向同步到HDFS? (或继续不完整的hdfs上传?)
- linux – ELF文件TLS和LOAD程序部分
- Linux实用程序和守护程序的源代码
- linux-kernel – 从FIQ中断处理程序访问内核驱动程序数据失