When you state that the only way to connect to the machine is via SSH it implies that the machine has either a known IP (which you do not know) or a known name. If that is so, just resolve the name:
dig NameOfComputerToSSH
I am giving the example with dig (and it may also be dig +short name
), but many other tools are available, like getent, ip, nslookup, host and many more
If the above is not a solution for your case, then: When you state:
physically connected to my network
Does it mean that the computer is able to communicate with other computers on your network or the internet?
If yes, then it must have an IP (either IPv4 or IPv6).
If IPv4
You can scan at level 3 (IP level) with (similar to) nmap -sn 192.168.1.1/24
as an user. The command example will only scan the xxx.yyy.1.zzz
segment. For all segments (as you state that you only know the 192.168
prefix) you will need to use (very very slow, more than 1 hour ), note the trailing 16
:
nmap -sn 192.168.1.1/16
If you have root access, nmap could execute an ARP scan (faster but still in the hour range) with the same command, or, you can install and try (about 2 minutes 13 seconds for 65536 IPs with default network speed):
arp-scan --localnet
Or, if you must specify the network segment: apr-scan 192.168.11.11/16
or similar.
If IPv6
There is NO practical way to scan a local network for existing computers in a reasonable time. The fe80::/64 has 264 IPs, that's 248 (281.474.976.710.656) times the 192.168.x.y
range (well, technically the range is fe80::/10, but it must be followed by 54 zeros, so, that's equivalent to the /64). And that is just one of the possible IP ranges an interface could have (interfaces are multihomed).
But, there is a command to find the neighbors (that have been active):
ip -6 neigh
162.168
just a typo and should have been a192.168
? – Nov 04 '18 at 03:54