[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)作中,不過僅會(huì)有警告信息并不會(huì)實(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)生效。
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。
網(wǎng)站標(biāo)題:Linux下防火墻和selinux的啟動(dòng)、關(guān)閉和查看-創(chuàng)新互聯(lián)
瀏覽路徑:http://chinadenli.net/article6/djgeog.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站營銷、虛擬主機(jī)、移動(dòng)網(wǎng)站建設(shè)、響應(yīng)式網(wǎng)站、ChatGPT、Google
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容