How To Connect To A WPA Wifi Using Command Lines On Debian

First install the package wpasupplicant


aptitude install wpasupplicant


Then we will configure a network, so we create and modify the configuration file:



vim /etc/wpa_supplicant.conf


Complete the file to make it look like that (replacing wifi_name and wifi_key by their real values of course). Press "i" to be able to edit.


network={


ssid="wifi_name"


psk="wifi_key"


}

Then exit and save (press escape then :wq)


The wifi network is now configured, we must now tell that we want to connect to it using this configuration file.


wpa_supplicant -B -iwlan0 -c/etc/wpa_supplicant.conf -Dwext


If your interface isn't named wlan0 then replace wlan0 by the real name of your interface.


We must now request an IP adress.



dhclient wlan0

No comments:

Post a Comment