Connect to an Access Point using IWCONFIG

I have done the follow steps.

  • sudo ifconfig wlan0 up

  • sudo iwlist wlan0 scan (I see my access point without problem)

then...

  • sudo iwconfig wlan0 essid MY_ESSID key s:MY_PASSWORD

I get the follow error:

 Error for wireless request "Set
 Encode" (8B2A) :
     SET failed on device wlan0 ; Invalid argument.

I used s: because I want to pass and ASCII password.

What is the error?

Thank you!


Since you're trying to connect to an AP advertising WPA2-PSK, you will have to use wpa_supplicant.

There are GUI frontend apps to connect, you could try wicd or networkmanager.