Monday, February 11, 2013

One-Liner: Connect to a WPA Secured WIFI-Network from the command line

Just replace PASSPHRASE, ESSID and maybe wlan0 with your real network interface name.
to scan for available networks, use
iwlist wlan0 scan | grep -i essid

Watch out! Passphrase is visible on command line and probably in the bash history!
sudo ifconfig wlan0 up ; echo 'PASSPHRASE' | wpa_passphrase 'ESSID' | sudo wpa_supplicant  -iwlan0 -c /dev/stdin > /tmp/wpa_supplicant.log 2>&1 & sudo dhclient wlan0 &

 

No comments:

Post a Comment