You can use a nmap command to scan a single server using a host name such as server1.cyberciti.biz or an IP address such as 192.168.1.254. The syntax is:
This example demonstrates port scanning using an IP address:
$ nmap 192.168.1.1
This example demonstrates port scanning using a host name:
$ nmap router
Understanding nmap command output
- Not shown: 998 closed ports - By default nmap will show open ports only in the following format.
- PORT - Port number with protocol.
- STATE -The state is either open, filtered, closed, or unfiltered. Open state means that an application on the target machine is listening for connections/packets on that port. Filtered state means that a firewall, filter, or other network obstacle is blocking the port so that Nmap cannot tell whether it is open or closed.
- SERVICE The service name. For example, the port # 22 is often used by ssh service such as OpenSSH server or the port # 80 is often used by a web server such as Apache.
To scan multiple IP addresses or hosts names:
$ nmap server1 server2 server2.nixcraft.net.in
$ nmap 192.168.1.1 192.168.1.2
Tip: You can use nmap 192.168.1.1,2 instead of typing nmap 192.168.1.1 192.168.1.2, as both IP addresses are part of the same subnet 192.168.1.0/24.
To speed up nmap execution pass the -T4 option as follows:
$ nmap -T4 192.168.1.1
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012
- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop