6

I'm writing a bash script that is intended to update a Raspberry Pi's wifi settings contained with /etc/wpa_supplicant/wpa_supplicant.conf (running raspbian 9 stretch).

As per the official Raspberry Pi documentation, I am making use of the wpa_passphrase command, in which I can input the ESSID and password of my desired network and then append it's output onto the end of the existing /etc/wpa_supplicant/wpa_supplicant.conf file, before reloading the settings with wpa_cli -i wlan0 reconfigure.

This is all fine and dandy and works great, but I noticed that it doesn't produce any key_mgmt fields, unlike if you were to manually log into a network via the desktop GUI.

I'm just curious if there is any harm in not having that key_mgmt field explicitly defined? What is its use case, if networks can be connected to without trouble without it (at least in my cases). I read through the sparse documentation for wpa and wpa_supplicant, and it didn't tell me much.

For reference, the networks that I noticed would work with or without this field would have the key_mgmt=WPA-PSK if I logged in via the RPi's desktop GUI. All the networks I tested with had this in common.

Thanks in advance!

Tyrel Kostyk
  • 506
  • 1
  • 5
  • 11
  • This doesn't really sound like a programming question; the fact that you're scripting it seems to be beside the point. This would be more appropriate in [unix.se] or [raspberrypi.se] – Barmar Jun 24 '19 at 23:37
  • 8
    From [this](https://w1.fi/cgit/hostap/plain/wpa_supplicant/wpa_supplicant.conf): `key_mgmt: list of accepted authenticated key management protocols` - if there is a network with matching name but with different authentication method, the block will not match the network. The default is WPA-PSK WPA-EAP, so if you specify PSK without key_mgmt, WPA-PSK is anyway inferred. – KamilCuk Jun 24 '19 at 23:42

0 Answers0