I just wanted to try out how to connect to my WIFI WPA2 via terminal.

Therefore I created "/etc/wpa_supplicant"

network = { 
  ssid = "nameOfWifi"
  psk = "passwordNumberThatIFoundOnTheWifiHardware"

Then I started following command

sudo wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf -D nl89211

No Errors thrown. Up to the last step

Launching command to connect to my Wifi now

sudo dhclient -v wlan0


//Meta infos...
Listening on LPF/wlan0/00:1e:65:bb:4e:ee
Sending on LPF/wlan0/00:1e:65:bb:4e:ee
Sending on Socket/fallback

DHCPDISCOVER on wlan0 to port 97 interval 3 (xid:0x18018e53)
DHCPDISCOVER on wlan0 to port 97 interval 4 (xid:0x18018e53)
DHCPDISCOVER on wlan0 to port 97 interval 5 (xid:0x18018e53)

What do I miss here? If there're wrong credentials - how can I figure out some error message for that case? Is there a more detailed debug/verbose?

  • please edit and add the ouput of lspci -knn | grep Net -A2. – GAD3R Jun 3 '16 at 22:25

You need to use wpa_passphrase when creating a configuration file for a WPA network. wpa_passphrase is included with the wpa_supplicant package.

Example: wpa_passphrase "nameOfWifi" "password" > /etc/wpa_supplicant.conf

  • Man page: linux.die.net/man/8/wpa_passphrase – Peschke Jun 3 '16 at 16:49
  • Thanks you made my day! Wasn't aware that my psk is a generated passsword - just thought its the plain password I enter when I use the GUI aswell :D – xetra11 Jun 4 '16 at 15:24
  • You are welcome :) Before the GUI sends your password to a WPA network, it actually encrypts it also! – Peschke Jun 4 '16 at 16:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.