中文字幕亚洲第一精品|精品国产免费一区二区|久久婷婷五月六月综合版|中文字幕熟妇久久久人妻|久久综合精品国产一区无码|国产成人精品永久免费视频|午夜亚洲国产精品理论片a级|久久精品一区二区三区无码护土

 訪問手機(jī)版  

Linux常用命令|Linux培訓(xùn)學(xué)習(xí)|考試認(rèn)證|工資待遇與招聘,認(rèn)準(zhǔn)超級(jí)網(wǎng)工!

招聘|合作 登陸|注冊(cè)

網(wǎng)絡(luò)工程師培訓(xùn)

當(dāng)前位置:網(wǎng)絡(luò)工程師 > 技術(shù)課程 > linux > 熱點(diǎn)關(guān)注 > linux常用命令

linux常用命令(防火墻)

時(shí)間:2019-06-08

linux常用命令_linux關(guān)機(jī)命令重啟命令_常用dos命令大全及其用法

# vim /etc/selinux/config # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: #enforcing - SELinux security policy is enforced. #permissive - SELinux prints warnings instead of enforcing. #disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of three two values: #targeted - Targeted processes are protected, #minimum - Modification of targeted policy. Only selected processes are protected. #mls - Multi Level Security protection. SELINUXTYPE=targeted

將SELINUX=enforcing修改為SELINUX=disabled。

重啟linux系統(tǒng),然后使用getenforce命令查看當(dāng)前的SELINUX狀態(tài):

# getenforce Disabled

常用dos命令大全及其用法_linux常用命令_linux關(guān)機(jī)命令重啟命令

我使用的Linux發(fā)行版是CentOS,CentOS 7的默認(rèn)防火墻工具是firewalld,Cent OS6的默認(rèn)防火墻工具是iptables。

首先,需要知道當(dāng)前系統(tǒng)安裝的防火墻工具的是firewalld,還是iptableslinux常用命令linux常用命令,可以使用下面的命令進(jìn)行驗(yàn)證:

# systemctl status firewalld ● firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2018-07-12 10:50:29 CST; 6min agoDocs: man:firewalld(1) Main PID: 726 (firewalld) CGroup: /system.slice/firewalld.service└─726 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

可以看到Active: active (running),說明默認(rèn)的firewalld已經(jīng)在運(yùn)行了。

linux關(guān)機(jī)命令重啟命令_常用dos命令大全及其用法_linux常用命令

# systemctl status iptables Unit iptables.service could not be found.

說明沒有安裝iptables。

關(guān)閉防火墻:

# systemctl stop firewalld

linux關(guān)機(jī)命令重啟命令_linux常用命令_常用dos命令大全及其用法

此時(shí)如果重新執(zhí)行systemctl status firewalld,可以看到狀態(tài)為:Active: inactive (dead)

禁止開機(jī)啟動(dòng):

# systemctl disable firewalld Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service. Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

打開防火墻

linux常用命令_常用dos命令大全及其用法_linux關(guān)機(jī)命令重啟命令

# systemctl start firewalld

設(shè)置開機(jī)啟動(dòng)

# systemctl enable smb.serviceln -s '/usr/lib/systemd/system/smb.service' '/etc/systemd/system/multi-user.target.wants/smb.service'。created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.。created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-agent.service to /usr/lib/systemd/system/zabbix-agent.service.。

以后有時(shí)間再寫防火墻規(guī)則的查看、增加、刪除。

 上一個(gè)教程:linux操作常用命令