Tuesday, 29 September 2015

How to connect to WiFi using command line Ubuntu, Debian etc.

Tried to upgrade to Ubuntu 15.10 Beta 2, rebooted  and my system was broken. Could not connect to LAN, so my only option was to connect to Wifi via command line to hopefully repair my system.

This is what I did.

First, open a terminal:


If you got WPA like me you need wpa_supplicant to set it up, because iw can only handle WEP.

To bring up your wireless device (most likely wlan0):
sudo -s
ifconfig wlan0 up
#now scan for available wifi networks and note the ssid of your device
iwlist wlan0 scan
In /etc/wpa_supplicant.conf we need to put our ssid and password:
nano /etc/wpa_supplicant.conf
Example config:
                     psk="wifi password"

Ctrl + A to close and save.
To connect:
sudo wpa_supplicant -B -iwlan0 -c/etc/wpa_supplicant.conf -Dwext
Open a second tab/terminal:
sudo dhclient wlan0
Your connection should now work!


  1. Unlike windows operating system Ubuntu has always been incompatible with most local area networks thanks to the blog the process has been simplified.

  2. Wi-Fi Alliance is pioneer in creating WiFi innovation and all the equipment related with Wifi is for the most part confirmed by Wifi Alliance consistence.best router for gaming

  3. Notwithstanding, presently, most endeavor WiFi systems have generally low use. Later on, as remote LANs expect a more focal part, obstruction issues could turn out to be more basic.wifi name ideas

  4. Hi,Thanks for the information about this Really nice Post.

  5. Thanks for the help, now i am able to connect by command, Check Funny WiFi Names Puns Collection: wifipuns