How to scan local network for SSH-able computers?
I am often on one computer in my house and I would like to SSH to another one, but often don't know the IP address of the one I want to connect to. Is there a way, from the command line, to scan the local network so I can find the computer I want to connect to?
Use "nmap" - this will tell you which hosts are up on a network, and indeed which have port 22 open. You could combine it with a few other tools (like grep) to produce more targeted output if need be.
Note: do this only on YOUR network. Running up nmap or its equivalents on someone else's network is considered bad form.
sudo nmap -p 22 192.168.0.0/24
From the command line you could use:
sudo nmap -sS -p 22 192.168.10.0/24
Substitute for the local address space on your network. I sometimes use this when I plug in a headless rasberry pi and want to find where to ssh to.