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端口服务
53端口:多播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
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
ss -ntlp
exit