2

I can connect to wifi

sudo ifconfig wlan0 up sudo iwconfig wlan0 essid sudo dhclient wlan0

but I don't know how to connect to encrypted wlan so please tell me how to do that, if a wifi password is "abcdef" Thank you.

potato
  • 23
  • 6

1 Answers1

0

But this is only working with WEP encryption:

sudo iwconfig wlan0 essid name key s:abcdef

sudo dhclient wlan0

WPA

You will need to install wpa-supplicant (sudo apt-get install wpasupplicant)

After you have installed edit the sudo nano /etc/wpa_supplicant.conf

For example:

network={
            ssid="ssid_name"
             psk="abcdef"
}

And finally you can connect with commands:

sudo wpa_supplicant -B -iwlan0 -c/etc/wpa_supplicant.conf -Dwext && sudo dhclient wlan0

IamK
  • 2,753
  • 5
  • 30
  • 39
  • Oh my god! That is definitely what I want. Actually I don't know what WPA is, so I ignore the script about that. So..Thank you so much, you are my life saver haha. – potato Oct 13 '15 at 13:08