CentOS常用命令

2021-09-13 21:44:11 字數 1458 閱讀 2066

# systemctl start firewalld # 啟動,

# systemctl enable firewalld # 開機啟動

# systemctl stop firewalld # 關閉

# systemctl disable firewalld # 取消開機啟動

firewall-cmd --zone=dmz --add-port=8080/tcp

firewall-cmd --zone=dmz --add-port=80/tcp --permanent

firewall-cmd --zone=dmz --add-port=8002/tcp

允許某範圍的 udp 埠至 public 級別,並永久生效

# firewall-cmd --zome=public --add-port=5060-5059/udp --permanent

um install iptables-services

systemctl mask firewalld.service

systemctl enable iptables.service

systemctl enable ip6tables.service

靜態防火牆規則配置檔案是 /etc/sysconfig/iptables 以及 /etc/sysconfig/ip6tables .

注: iptables 與 iptables-services 軟體包不提供與服務配套使用的防火牆規則. 這些服務是用來保障相容性以及供想使用自己防火牆規則的人使用的. 你可以安裝並使用 system-config-firewall 來建立上述服務需要的規則. 為了能使用 system-config-firewall, 你必須停止 firewalld.

為服務建立規則並停用 firewalld 後,就可以啟用 iptables 與 ip6tables 服務了:

CentOS常用命令

1.顯示當前目錄所有的檔案和目錄資訊 ls list ls xx目錄 檢視指定目錄下邊的檔案資訊 2.顯示當前檔案目錄位置 pwd 3.目錄之間切換 cd 目錄名字 cd 切換到上級目錄 4.切換到完全命令模式 init 3 進入命令模式 init 5 進入視覺化操作介面 5.使用者切換到超級管理員...

centos 常用命令

遠端鏈結 連交換機 telnet 192.168.1.241 username password 查埠 dis inter br 退出 ctrl 再按 quit 程序 殺程序 kill 9 5144 或 kill term 5144 9表示無條件 顯示程序 ps auxw 或 ps ef grep ...

centos 常用命令

建立目錄 mkdir p 目錄名 開啟目錄 cd 目錄名 1 cd 進入當前使用者的家目錄 2 cd 進入上次目錄 3 cd 進入上一級目錄 4 cd 進入當前目錄 檢視當前路徑 pwd 刪除目錄 rm rf 目錄名 rm 只能刪除空目錄 複製 cp 選項 目錄或檔案 目標目錄 1 r 複製目錄 2...