Thanks Trapster.
Rather than installing depreciated software I worked out a way to do it with the preinstalled packages.
Method 1 (open network):
Code: Select all
cat > /etc/wpa_supplicant/wpa_supplicant.conf << EOF
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
ssid="Channel2B"
key_mgmt=NONE
}
EOF
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
Method 1 (cleartext password):
Code: Select all
cat > /etc/wpa_supplicant/wpa_supplicant.conf << EOF
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
ssid="Channel2B"
psk="password"
}
EOF
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
Method 1 (hashed password):
Code: Select all
echo -n password | iconv -t utf16le | openssl md4
use the hash below
Code: Select all
cat > /etc/wpa_supplicant/wpa_supplicant.conf << EOF
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
ssid="Channel2B"
password=hash:hash_from_above
}
EOF
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
Method 1 (alternative hashed password):
Code: Select all
wpa_passphrase "Channel2B" password
that will produce output like:
Code: Select all
network={
ssid="Channel2B"
#psk="password"
psk=1b964719888513fdebf19047efdf4b6f182eef9d2d58639eb9e25f437cd30da8
}
remove the line with your password so you get
Code: Select all
network={
ssid="Channel2B"
psk=1b964719888513fdebf19047efdf4b6f182eef9d2d58639eb9e25f437cd30da8
}
then use that stanza below
Code: Select all
cat > /etc/wpa_supplicant/wpa_supplicant.conf << EOF
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
ssid="Channel2B"
psk=1b964719888513fdebf19047efdf4b6f182eef9d2d58639eb9e25f437cd30da8
}
EOF
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
the line that reads
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
could also simply be
ctrl_interface=/run/wpa_supplicant
Method 2 (open network)
Code: Select all
cat > /etc/wpa_supplicant/wpa_supplicant.conf << EOF
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
EOF
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
wpa_cli scan
wpa_cli scan_results
wpa_cli add_network
wpa_cli set_network 0 ssid '"Channel2B"'
wpa_cli set_network 0 key_mgmt NONE
wpa_cli enable_network 0
#optional
wpa_cli save_config
ip a
Method 2 (cleartext password)
Code: Select all
cat > /etc/wpa_supplicant/wpa_supplicant.conf << EOF
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
EOF
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
wpa_cli scan
wpa_cli scan_results
wpa_cli add_network
wpa_cli set_network 0 ssid '"Channel2B"'
wpa_cli set_network 0 psk '"password"'
wpa_cli enable_network 0
#optional
wpa_cli save_config
ip a
Method 2 (hashed password)
Generate your hash with one of the methods used above in method 1 then use it instead of the password.
Code: Select all
cat > /etc/wpa_supplicant/wpa_supplicant.conf << EOF
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
EOF
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
wpa_cli scan
wpa_cli scan_results
wpa_cli add_network
wpa_cli set_network 0 ssid '"Channel2B"'
wpa_cli set_network 0 psk '"password_hash"'
wpa_cli enable_network 0
#optional
wpa_cli save_config
ip a
When the config is saved then Method 2 can be started after a reboot with
Code: Select all
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
wpa_cli enable_network 0
I didn't fully test every option, but I tested a lot of them to the point where it was working for me.
You can create a shell script to run any of these by starting the file with #!/bin/sh