Hash your password when connecting through wired 802.1x authentication
netplan has been the default network configuration tool since Ubuntu 20. Several hash solutions based on
netplan didn’t work in practice, so I switched to the
ifupdown for configuration.
Current os version: Ubuntu 20.04 focal
sudo apt install ifupdown net-tools
wpa_supplicant configuration for the network.
ifconfig # find your network device name, just find the one you want to use. For me it's "enp0s31f6"
echo -n plaintext_password_here | iconv -t UTF-16LE | openssl md4 # generate hashed password (you need to use appropriate hash method to generate. md4 is corresponding to MSCHAPV2 authentication in phase2)
Create and edit the configuration file
wpa_supplicant_enp0s31f6.conf (any file name you want) under the
/etc/wpa_supplicant folder. Replace your hased password (in the form of
hash:your_hashed_password) and identity.
/etc/network/interface as below, remember to replace the network device name and wpa configuration file.
# Include files from /etc/network/interfaces.d:
# the loopback network interface
iface lo inet loopback
# the primary network interface
iface enp0s31f6 inet dhcp
Disable current network manager
Disable any services related to
sudo systemctl stop NetworkManager.service
sudo systemctl disable NetworkManager.service
sudo systemctl stop systemd-networkd.socket
sudo systemctl disable systemd-networkd.socket
sudo systemctl stop systemd-networkd.service
sudo systemctl disable systemd-networkd.service
Reboot and check whether it can automatically connect to the network.