I have a Linux server running on a laptop.
I would like it to auto-connect to any open WiFi network automatically. (Without knowing the SSID beforehand)
It's for a remote server deployment of ZoneMinder @ a cabin on a large property. If the burglars are REALLY smart they could get on the WiFi and hack the ZoneMinder server, but I highly doubt it and my "client" aka my parents have the WiFi set to Open.
Best Answer
To have your computer search and connect to ANY Open Wifi modifiy the following two files:
*This was tested on Ubuntu 14.04 x64 Server
/etc/network/interfaces
/etc/wpa_supplicant/wpa_supplicant.conf
Now bring interface down/up and check status.
Look for
Testing:
use both ifconfig/ping
IF ifconfig show's no private IP and ping should fail
try again and should show privateIP and ping should succeed.
To manually connect via config for debugging use this:
-d = debug/verbose -dd == super verbose
-D = driver
wext = "catch-all driver"
I tested with phone via hotspot which is PERFECT because it tells you when a client connects. I also turned off HotSpot and it reconnected when it turned back on! Only down side is if you are in a populated area, like my testing environment, it connected to "Xfinity-Wifi" which is open and then I had to reboot then it seemed to go with my hotspot due to it being a stronger signal. But once it was on XFinity it would not leave it unless I specified the Open Network SSID inside of the wpa_supplicant.conf OR rebooted.