以LINUX REDHAT6.3为例:
本机插入 REDHAT6.3系统ISO镜像CD1
1.配置yum本地安装源:
以root用户登录系统
mkdir /mnt/cdrom
mount -t iso9660 /dev/sr0 /mnt/cdrom
cd /etc/yum.repos.d
查看目录是否有.repo后缀文件,没有则创建一个.repo文件,文件名随意。
vi local.repo
[LOCAL]
name=local
baseurl=file:///mnt/cdrom
enable=1
gpgcheck=0
yum clean all
2.安装nmap,并测试172.24.40.5是否开放80端口
- [root@openlab named]# yum install nmap
- Loaded plugins: rhnplugin
- Repository 'LOCAL' is missing name in configuration, using id
- This system is not registered with RHN.
- RHN support will be disabled.
- Setting up Install Process
- Resolving Dependencies
- --> Running transaction check
- ---> Package nmap.i686 2:5.21-3.el6 set to be updated
- --> Finished Dependency Resolution
- Dependencies Resolved
- ================================================================================
- Package Arch Version Repository Size
- ================================================================================
- Installing:
- nmap i686 2:5.21-3.el6 LOCAL 2.2 M
- Transaction Summary
- ================================================================================
- Install 1 Package(s)
- Upgrade 0 Package(s)
- Total download size: 2.2 M
- Installed size: 7.2 M
- Is this ok [y/N]: y
- Downloading Packages:
- Running rpm_check_debug
- Running Transaction Test
- Transaction Test Succeeded
- Running Transaction
- Installing : 2:nmap-5.21-3.el6.i686 1/1
- Installed:
- nmap.i686 2:5.21-3.el6
- Complete!
- [root@openlab named]# nmap -p 80 172.24.40.5
- Starting Nmap 5.21 ( http://nmap.org ) at 2013-01-09 17:00 CST
- mass_dns: warning: Unable to determine any DNS servers. Reverse DNS is disabled. Try using --system-dns or specify valid servers with --dns-servers
- Nmap scan report for 172.24.40.5
- Host is up (0.00034s latency).
- PORT STATE SERVICE
- 80/tcp open http
- MAC Address: 00:0C:29:4E:7D:FE (VMware)
- Nmap done: 1 IP address (1 host up) scanned in 0.07 seconds
nmap -p 1-200 目标主机 IP
#1-200为端口范围
本文转自 showerlee 51CTO博客,原文链接:http://blog.51cto.com/showerlee/1119506,如需转载请自行联系原作者