Skip to content

Instantly share code, notes, and snippets.

@davidhoness
Created November 19, 2018 13:00
Show Gist options
  • Save davidhoness/5ee50e881b63c7944c25b8de33453823 to your computer and use it in GitHub Desktop.
Save davidhoness/5ee50e881b63c7944c25b8de33453823 to your computer and use it in GitHub Desktop.
Connecting a Raspberry Pi to WPA2 Enterprise Wireless Network
network={
ssid="ssid"
scan_ssid=1
key_mgmt=WPA-EAP
group=CCMP TKIP
eap=PEAP
identity="username"
password=hash:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
phase1="peapver=0"
phase2="MSCHAPV2"
}
@davidhoness
Copy link
Author

Tested on Raspbian Stretch.

Never store your password as plain text on a Raspberry Pi file system. Generate a password hash

echo -n password_in_plaintext | iconv -t utf16le | openssl md4

Take the 32 character long code and replace the X's in the password line of the template wpa_supplicant.conf
Also update the ssid and identity fields with the correct information.

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Ctrl - O followed by Enter to save, and Ctrl - X to quit from nano
Apply the config and the Raspberry Pi should connect after a moment

wpa_cli -i wlan0 reconfigure

Clear the command line history to remove a record of your password being typed into the terminal

history -c
rm ~/.bash_history

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment