I would like to get a list of all the wireless networks.
iwlist wlan0 scan | grep ESSID
This will only show me the wireless network I am currently connected to. When I run the command as root, it shows me all the available networks. If I run the command without sudo quickly after this, all the networks will show up, but after a while they are all gone except the network I am currently connected to.
Is there a way to get all the available networks when I am not root?
Best Answer
You could (or do?) probably use
wpa_supplicant
; using itsctrl_interface
configuration key, you can allow non-root users (e.g. those with groupwheel
) access viawpa_cli
(i.e./sbin/wpa_cli scan_results
[1])There's also a command-line switch to
wpa_suppliant
,giving you a DBus interface and thus another possibility for non-root access (I think NetworkManager uses this interface).
[1] Once connected, this only shows the wireless LAN you are connected to...I don't know if this is any different with NetworkManager.