cenetos7 采用systemd來管理服務
centos7 沒有采用傳統的iptables服務, 而是采用的firewalld 服務, 以及firewall-cmd 命令;
也可以采用傳統的 iptables.service服務來管理防火牆, 但是要安裝 iptables-service 程序軟件.
如果沒有安裝iptabes-service "軟件/程序" , 將沒有iptables命令, 自然就會提示 沒有...文件或目錄了....
yum install iptables-service;
systemctl start|stop|restart|save|status iptalbes.service
原始的firewalld管理是:
service firewalld start.
centos7 系統默認的防火牆服務叫 firewalld 或: firewalld.service.
關於iptables-services?
-
安裝的程序包, 叫 iptables-services, 注意是iptables, 不是iptable單數; 是services不是 service單數, 可能是因為這個包即包含ipv4, 也包含ipv6.
-
安裝后 並沒iptables-service(s)命令存在, 可能只是在 /usr/lib/systemd/system/iptables.servce這個服務 (服務實際上也是一個文件/目錄 是可執行的程序文件等....)
-
啟動iptables.service, 你可以使用 systemmctl 也可以還是使用老的, service service_name start/status 等, 系統會自動重定向 redirecting to...systemctl....
- 防火牆用 iptables 管理的, 很明確, 可以清楚地看到filter表 中的 三個 鏈的規則情況:
========================================================
從主機上訪問虛擬機上的httpd主頁, 開始時訪問不上, 根據"四部曲"排錯思路, 臨時禁用iptables 就可以訪問了:
telnet中文亂碼: 通過設置: $LANG="zh_CN.GB18030"
默認情況下, centos7是安裝並啟用了ssh服務的, 而且用securecrt是很好地 連接登錄到centos的;
但是, 在默認情況下, 是沒有安裝 沒有開啟telnet(server)服務的, 如果要用telnet登錄連接的話, 就要安裝 telnet-server程序包:
centos的yum 不能連接到 鏡像或163 sohu等服務器,, 通常/多半是由於, 原來采用的是dhcp, 后來改成了static, 於是,沒有了dns, 所以無法解析域名....
安裝了telnet-server后, 如何啟動telnet服務器?
這時候, 實際上是啟動的 telnet.socket.
還需要安裝 xinetd 程序包, 因為telnet是由 xinetd來管理的.
用service 或systemctl 分別啟動/ 或將 enable:: telnet.socket 和xinetd.service (默認的就是服務)
用telnet登錄比較麻煩, 使用shh2登錄比較容易而且 還更安全:
可以直接定義靜態地址, 的網關:用 GATEWAY=192.168.1.1就好了!
ssh2 沒有目錄和文件 的顏色區別?
這個不是ssh的事, 即使你用telnet登錄也是這樣,
應該是, 設置secureCRT的終端模擬設置, 可以設置, emulation->terminal: linux或xterm. 背景選traditional