Setting up Wifi with the Command Line

This tutorial works best if your router is broadcasting the SSID. Make sure you have “Broadcast SSID” set up on your router! This may not work with “private” SSID setups

Working USB WIFI adapters.

Boot the Raspberry Pi without the WiFi adapter plugged in.

At the terminal prompt, use the following command to open the network config file with editor:


Use the example below to modify the network settings:


(your ssid=change this to your wifi SSID, your wi-fi password=change this to your wifi password)

Save the file using CTRL-X and then Y.

Power off the Raspberry Pi using sudo halt, unplug the power.

We use sudo command for “run as admin” as the standard account is not an admin,  you can not shutdown or reboot the raspberry pi with a normal account.

If you are working directly on the Pi, within a few seconds you should get a message that the system has halted. If you are logged in through ssh, you’ll find that your console window will close.

If you had the Pi connected through ethernet, unplug the ethernet cable and plug in the usb Wi-Fi dongle. Power on your Pi, and it should connect to your Wi-Fi network.


 Next Tutorial (Coming Soon)