查看端口使用情况
netstat -apn
netstat -apn | grep 25
查看端口是否对外开放
nc
nc ip 25
nc 127.0.0.1 25 #不是对外开放状态
[root~]# nc 127.0.0.1 25
220 hq.localdomain ESMTP Postfix
[root ~]# nc 1.2.3.4 25
Ncat: Connection refused.
telnet
...
通过iptables禁用
"sudo iptables -A INPUT -p tcp --dport $PORT -j DROP"
"sudo iptables -A OUTPUT -p tcp --dport $PORT -j DROP"