Centos6.x Desktop 關閉防護墻及無關服務
阿新 • • 發佈:2018-11-28
1,檢視iptables並關閉服務、禁止自啟動
~]# service iptables status ~]# service iptables stop ~]# chkconfig iptables off ~]# service iptables status
2,關閉selinux
~]# sed -i '[email protected]=.*@[email protected]' /etc/selinux/config ~]# setenforce 0
3,重啟生效,並確認狀態
~]# reboot ~]# getenforce
4,檢視啟動的服務
~]# netstat -tnlp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1321/rpcbind tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1626/sshd tcp 0 0 0.0.0.0:43638 0.0.0.0:* LISTEN 1449/rpc.statd tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1505/cupsd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1706/master tcp 0 0 :::111 :::* LISTEN 1321/rpcbind tcp 0 0 :::22 :::* LISTEN 1626/sshd tcp 0 0 ::1:631 :::* LISTEN 1505/cupsd tcp 0 0 ::1:25 :::* LISTEN 1706/master tcp 0 0 :::49753 :::* LISTEN 1449/rpc.statd
5,關閉無關rpcbind 、rpcbind 、cupsd服務
~]# service nfslock stop ~]# chkconfig nfslock off ~]# service rpcbind stop ~]# chkconfig rpcbind off ~]# service cups stop ~]# chkconfig cups off
6,檢視現有服務
~]# netstat -tnlp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1596/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1676/master tcp 0 0 :::22 :::* LISTEN 1596/sshd tcp 0 0 ::1:25 :::* LISTEN 1676/master