您好,登錄后才能下訂單哦!
[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)為關(guān)閉狀態(tài),active (running)為開啟狀態(tài)
[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狀態(tài)有三種模式:
enforcing:強(qiáng)制模式,代表selinux運(yùn)行中,且已經(jīng)正確的開始限制domain/type了。
permissive:寬容模式,代表selinux運(yùn)作中,不過僅會有警告信息并不會實(shí)際限制domain/type的訪問。這種模式可以用來作為selinux的debug之用
disabled:關(guān)閉,selinux沒有實(shí)際運(yùn)行。
命令設(shè)置SELinux,前提不能是disabled狀態(tài):
[root@localhost ~]# setenforce 0
[root@localhost ~]# getenforce
Permissive
其中setenforce 0|1
0:設(shè)置為premissive狀態(tài);
1:設(shè)置為enforcing狀態(tài);
此設(shè)置:重啟系統(tǒng)后無效。
修改配置文件,設(shè)置selinux為disabled狀態(tài):
[root@localhost ~]# vim /etc/selinux/config
SELINUX=disabled
SELINUXTYPE=targeted
保存,重啟系統(tǒng)生效。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。