How to scan a network for live hosts using Debian and nmap

Communications | Debian Support

Reciently, i was trying to find out how many computers were on a network remotely. Since i have debian for my main computer system, heres how you do it.

1) apt-get install nmap
2) laptop:~# nmap -sP -vv 192.168.1.* | grep up

Host 192.168.1.1 appears to be up.
Host 192.168.1.5 appears to be up.
Host 192.168.1.44 appears to be up.
Host 192.168.1.45 appears to be up.
Host 192.168.1.46 appears to be up.
Host 192.168.1.48 appears to be up.
Host 192.168.1.110 appears to be up.
Host 192.168.1.121 appears to be up.
Host 192.168.1.133 appears to be up.
Host 192.168.1.141 appears to be up.
Host 192.168.1.143 appears to be up.
Host 192.168.1.186 appears to be up.
Nmap finished: 256 IP addresses (12 hosts up) scanned in 762.662 seconds

Similarly i can scan a network to see which computers will accept a remote desktop connection which uses port 3389

nmap -sS -vv -p 3389 192.168.1.* | grep open

Discovered open port 3389/tcp on 192.168.1.5
3389/tcp open ms-term-ser
from this you know which ips will respond to which ports.

This will save you alot of time!