We already saw how to set wpa_supplicant by hand on a text console, but there’s a extra step left: how to set your wireless connection to get up automatically with the wp_supplicant parameters. On Debian based distributions you can achive this by editing file /etc/network/interfaces in two ways, the first one like this:
iface wlan0 inet dhcp wpa-ssid Galaxia wpa-psk acafbf83bd7256506f3b08137dfe2763f9456dc41c8718297e6838ce5a32a64e
The other way, the more elegant in my humble opinion, is by putting a line to refer the wap_supplicant setting file which provides those parameters:
iface wlan0 inet dhcp wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
File /etc/wpa_supplicant/wpa_supplicant.conf has the wireless network information to connect to, and it was previously generated as explained on this post: Setting wireless connexion in the comand line interface.
On other distributions you must set wpa_supplicant, run it an then ask the network parameters to the dchp server.
Reference: How to use a WiFi interface