[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)爲開啓狀態linux
[root@localhost sunan]# systemctl stop firewalld.service
[root@localhost sunan]# systemctl start firewalld.service
[root@localhost 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.
[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.
[root@localhost ~]# service iptables status
[root@localhost ~]# service iptables stop iptables: Setting chains to policy ACCEPT: filter [ OK ] iptables: Flushing firewall rules: [ OK ] iptables: Unloading modules: [ OK ]
[root@localhost ~]# service iptables start iptables: Applying firewall rules: [ OK ]
[root@localhost ~]# chkconfig iptables off
[root@localhost ~]# chkconfig iptables on
[root@localhost sunan]# getenforce Enforcing
selinux狀態有三種模式:
enforcing:強制模式,表明selinux運行中,且已經正確的開始限制domain/type了。
permissive:寬容模式,表明selinux運做中,不過僅會有警告信息並不會實際限制domain/type的訪問。這種模式能夠用來做爲selinux的debug之用
disabled:關閉,selinux沒有實際運行。
命令設置SELinux,前提不能是disabled狀態:vim
[root@localhost ~]# setenforce 0 [root@localhost ~]# getenforce Permissive
其中setenforce 0|1
0:設置爲premissive狀態;
1:設置爲enforcing狀態;
此設置:重啓系統後無效。
修改配置文件,設置selinux爲disabled狀態:dom
[root@localhost ~]# vim /etc/selinux/config SELINUX=disabled SELINUXTYPE=targeted
保存,重啓系統生效。ide