centos7關閉不必要的服務和端口


雲服務器開啟很多不必要的端口,造成安全隱患

TCP

25端口:郵件服務

systemctl stop postfix

53端口 :域名解析服務

systemctl stop rhel-domainname

111端口:SUN公司的RPC服務所有端口

systemctl stop rpcbind
systemctl stop rpcbind.socket
systemctl stop rpcbind.target

631端口:打印服務

systemctl stop cups

UDP

5353端口:多播DNS(multicastDNS)/DNS-SD網絡服務

systemctl stop avahi-daemon
systemctl stop avahi-daemon.socket

查看端口命令:

grep 端口號 /etc/services|head

一鍵停止禁用:

ss -ntlp
systemctl stop rhel-domainname
systemctl stop cups
systemctl stop rpcbind
systemctl stop rpcbind.socket
systemctl stop rpcbind.target
systemctl stop dnsmasq
systemctl stop postfix
systemctl stop avahi-daemon
systemctl stop avahi-daemon.socket
ifconfig virbr0 down
brctl delbr virbr0 systemctl disable rpcbind systemctl disable rpcbind.socket systemctl disable rpcbind.target systemctl disable cups systemctl disable dnsmasq systemctl disable rhel
-domainname systemctl disable postfix
systemctl disable avahi-daemon
systemctl disable avahi-daemon.socket
systemctl disable libvirtd
ss -ntlp
exit

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM