Edit /etc/network/interfaces
:
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto wlan0
iface wlan0 inet dhcp
wireless-essid MyHomeWifi
wpa_conf /etc/wpa_supplicant.conf
Edit /etc/wpa_supplicant.conf
:
network={
ssid="MyHomeWifi"
priority=5
psk=17bab633a283237145193182bb17bab633a283237145193182bbbfed62a1e286
}
You can generate the network block above by using wpa_passphrase:
wpa_passphrase MyHomeWifi passphrase
Edit /etc/udev/rules.d/70-persistent-net.rules
to remove the network entries you don't want (such as wlan2 instead of wlan0)