WiFi on a headless Raspberry Pi
I have no idea why the other guides for this take four pages.
Login to your pi’s terminal, and run the following two commands.
sudo su
wpa_passphrase YOUR_SSID
You’ll then be asked to enter the passphrase and confirm the passphrase. If they match; you’ll see a blurb that’s a config file fragment.
Good.
Now (still as su
) repeat the last step, but pipe-append the output to the supplicant file.
wpa_passphrase YOUR_SSID >> /etc/wpa_supplicant/wpa_supplicant.conf
You won’t see the instructions this time - but that’s okay. There are just two things left to do;
- remove the plain text password from the supplicant file
add
scan_ssid=1
so that it can find the network when it’s hiddensudo nano /etc/wpa_supplicant/wpa_supplicant.conf
Finally; reboot and run something like sudo apt-get update
to test it all.