ssh、selinux、防火牆等啟動與停止命令
ssh服務的啟動與停止1、查看是否安裝ssh rpm -qa | grep openssh
顯示結果中包含openssh-server-*,則說明已經安裝,直接啟動
2、啟動/狀態/停止service sshd start/status/stop
/etc/rc.d/init.d/sshd start
3、啟動/狀態/關閉防火牆:service iptables start/status/stop
/etc/rc.d/init.d/iptables stop
4、查看22端口是否開放:netstat -an|grep 22
5、查看SELinux狀態:
1、/usr/sbin/sestatus -v ##如果SELinux status參數為enabled即為開啟狀態
SELinux status: enabled
2、getenforce ##也可以用這個命令檢查
關閉SELinux:
1、臨時關閉(不用重啟機器):
setenforce 0 ##設置SELinux 成為permissive模式
##setenforce 1 設置SELinux 成為enforcing模式
2、修改配置文件需要重啟機器:
修改/etc/selinux/config 文件
將SELINUX=enforcing改為SELINUX=disabled
enabled則為啟動狀態,重啟機器即可。
最後更新:2017-04-03 16:49:18