nmap即(Network Mapper),是linux系统中一个常用的网络管理工具,可以扫描端口、嗅探主机所在的网络环境,以及判断网络中主机的操作系统等。
系统运维 www.osyunwei.com 温馨提醒:qihang01原创内容©版权所有,转载请注明出处及原文链接
下面教大家在CentOS中用nmap查看主机端口:
一、安装nmap
yum install nmap #输入y安装
二、使用nmap
nmap localhost #查看主机当前开放的端口
nmap -p 1024-65535 localhost #查看主机端口(1024-65535)中开放的端口
nmap -PS 192.168.21.163 #探测目标主机开放的端口
nmap -PS22,80,3306 192.168.21.163 #探测所列出的目标主机端口
nmap -O 192.168.21.163 #探测目标主机操作系统类型
nmap -A 192.168.21.163 #探测目标主机操作系统类型
nmap --help #更多nmap参数请查询帮助信息
系统运维 www.osyunwei.com 温馨提醒:qihang01原创内容©版权所有,转载请注明出处及原文链接
三、关闭或者打开主机端口
1、nmap localhost #查看主机当前开放端口
2、ntsysv #打开系统服务器管理器(需要先安装yum install ntsysv),选择要关闭或者打开的服务



