How can one use wpa_cli to connect to a WPA network without a password?

23,507

Solution 1

Short answer: set_network 0 key_mgmt NONE

Here is an example to connect to a network with security turned off:

> scan
OK
CTRL-EVENT-SCAN-RESULTS 
> scan_results 
bssid / frequency / signal level / flags / ssid
f8:d1:11:23:c2:2f       2412    76      [ESS]   BAYINET
f8:d1:11:23:c1:e9       2412    47      [ESS]   BAYINET
> add_network
0
> set_network 0 ssid "BAYINET"
OK
> set_network 0 key_mgmt NONE
OK
> enable_network 0
OK
CTRL-EVENT-SCAN-RESULTS
Trying to associate with f8:d1:11:23:c2:2f (SSID='BAYINET' freq=2412 MHz)
Association request to the driver failed
Associated with f8:d1:11:23:c2:2f
CTRL-EVENT-CONNECTED - Connection to f8:d1:11:23:c2:2f completed (auth) [id=1 id_str=]
> quit

you need the set_network 0 key_mgmt NONE part after you added your network SSID/BSSID then just enable the network with "enable network " and the interface is connecting...

Solution 2

Well, from looking at the output you posted, and the article you are following, you do not need to enter the second part, the

set_network 0 psk "SupahSecretPassphrase"

All you have to do is enter the first command, and looking at the output of your scan it should be

set_network 0 ssid UCSFguest

and you should be able to connect. I am saying based on the article you followed, and the output you posted in your question, if look at the list, the SSID you're trying to connect to, (I assume as it is the only open network, or guest network)

d8:c7:c8:ea:40:61 2412 -47 [ESS] UCSFguest

Does not show any security info like the others, for example

6c:f3:7f:57:69:60 2437 -52 [WPA-EAP-TKIP][WPA2-EAP-CCMP][ESS] UCSFwpa

Shows it to be a protected network using WPA, which you tell by the

[WPA-EAP-TKIP][WPA2-EAP-CCMP][ESS]

Try just using the connect command, and it should work.

Share:
23,507
user391339
Author by

user391339

programs

Updated on September 18, 2022

Comments

  • user391339
    user391339 over 1 year

    The guest network does not have a password. Yet, if I run wpa_passphrase to get a key I neet to provide a 8+ character passphrase.

    > scan
    OK
    > scan_results
    bssid / frequency / signal level / flags / ssid
    80:ea:96:ef:4d:9c   2437    -49 [WPA2-PSK-CCMP][ESS]    Sook Wah's Wi-Fi Network
    6c:f3:7f:57:69:61   2437    -51 [ESS]   UCSFguest
    d8:c7:c8:e9:80:63   2412    -46 [WPA2-EAP-CCMP][ESS]    eduroam
    d8:c7:c8:e9:80:61   2412    -47 [ESS]   UCSFguest
    6c:f3:7f:57:69:62   2437    -52 [WPA2-EAP-CCMP][ESS]    p@8n@55u5mu
    d8:c7:c8:e9:80:60   2412    -47 [WPA-EAP-TKIP][WPA2-EAP-CCMP][ESS]  UCSFwpa
    6c:f3:7f:57:69:63   2437    -52 [WPA2-EAP-CCMP][ESS]    eduroam
    d8:c7:c8:ea:40:62   2412    -46 [WPA2-EAP-CCMP][ESS]    p@8n@55u5mu
    d8:c7:c8:ea:40:63   2412    -47 [WPA2-EAP-CCMP][ESS]    eduroam
    d8:c7:c8:ea:40:60   2412    -49 [WPA-EAP-TKIP][WPA2-EAP-CCMP][ESS]  UCSFwpa
    74:ea:3a:a7:5d:76   2427    -70 [WPA-PSK-TKIP+CCMP][WPA2-PSK-TKIP+CCMP][ESS]    LR0e
    d8:c7:c8:e9:80:62   2412    -47 [WPA2-EAP-CCMP][ESS]    p@8n@55u5mu
    d8:c7:c8:ea:40:61   2412    -47 [ESS]   UCSFguest
    6c:f3:7f:57:69:60   2437    -52 [WPA-EAP-TKIP][WPA2-EAP-CCMP][ESS]  UCSFwpa
    <3>CTRL-EVENT-SCAN-RESULTS 
    <3>CTRL-EVENT-SCAN-RESULTS
    

    I am following these guidelines: http://sirlagz.net/2012/08/27/how-to-use-wpa_cli-to-connect-to-a-wireless-network/

    • Thomas Ward
      Thomas Ward over 9 years
      Short of a WPA2-Enterprise connection which is governed by cert auth and such, there is no such "No Password WPA" network, as evidenced in the scan output. Is the Guest network open but with a Captive Portal that makes you accept something? If so, then I believe your issue isn't going to be resolved in the command line wpa_cli as that operates differently than actual WPA auth.