Centos7关闭不必要的服务和端口

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

  • 3
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值