Great article here (thanks HowtoForge) that pretty much worked as-is on my Mac running macOS 10.13.6. Never knew about about ‘ssh-copy-id’, will come in very handy!
-
-
Scanning Mac WiFi networks from the command line
Thanks to osxdaily.com for this tip.
First, do this (one-time operation):
$ sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/local/bin/airport
Then, anytime you want to query the nearby Wi-Fi networks, make sure Wi-Fi is enabled, and do this:
$ airport -s
This will create output that looks like this (B/SSIDs changed to protect the innocent 🙂 ):
SSID BSSID RSSI CHANNEL HT CC SECURITY (auth/unicast/group)
XXXX 1a:2b:3c:4d:5e:6f -66 149 Y US WPA2(PSK/AES/AES)
XXXX 1a:2b:3c:4d:5e:6f -68 6 Y -- WPA2(PSK/AES/AES)
XXXX 1a:2b:3c:4d:5e:6f -43 6 Y US WPA2(PSK/AES/AES)
XXXX 1a:2b:3c:4d:5e:6f -65 6 Y -- WPA2(PSK/AES/AES)
XXXX 1a:2b:3c:4d:5e:6f -84 1 Y US WPA2(PSK/AES/AES)
XXXX 1a:2b:3c:4d:5e:6f -70 1 Y US WPA2(PSK/AES/AES)
XXXX 1a:2b:3c:4d:5e:6f -58 1 Y US WPA2(PSK/AES/AES)
XXXX 1a:2b:3c:4d:5e:6f -86 11 Y -- WPA(PSK/AES/AES) WPA2(PSK/AES/AES)
XXXX 1a:2b:3c:4d:5e:6f -85 11,-1 Y US WPA2(PSK/AES/AES)
XXXX 1a:2b:3c:4d:5e:6f -58 11 Y US WPA2(PSK/AES/AES) -
Find that program running on that port
macOS (tested on 10.11.6):
sudo lsof -i :80
…where ’80’ is the port you’re curious about (substitute any value).Thanks to Databasically. See also here.
Windows (tested on 10 Pro version 1709):
netstat -ano
…this will produce a list of ports in use and the PIDs using them)Thanks to @RickVanover.
Fedora 20
netstat -npl | grep 8013
…this will find the name of the process running on port 8013. Thanks to Vivek Gite at nixCraft.