In this article we will configure WIFI settings so that we can access the Raspberry Pi over SSH from our laptop.
We are using Raspberry Pi 3 B+ model.
We need to update the WIFI settings to that everytime Raspberry Pi is booted, it connects to the available WIFI network automatically.
- Login to your account on Raspberry Pi. If you haven't changed the password, default username and password is available in previous post.
- Now open the file
/etc/network/interfaces in nano editor. We need to edit it, open it with root permissions. Use below command.
sudo nano /etc/network/interfaces
- Add below lines in the file.
iface wlan0 inet dhcp
wpa-ssid "WIFI NETWORK NAME HERE"
wpa-psk "WIFI NETWORK PASSWORD HERE"
- Update the localization settings to set the WIFI country. Open the file
/etc/wpa_supplicant/wpa_supplicant.conf and make below entries in it.
country=YOUR COUNTRY CODE HERE
You can enable SSH using one of the method below. Try and see which one works for you.
- Open the Raspberry Pi configurations using command
- Select Interfacing Option and then SSH.
- Enable SSH. Save and Exit.
- Create a file name ssh without extension in
/boot partition of Raspberry Pi.
- Use below commands to enable and start the SSH.
sudo systemctl enable ssh
sudo systemctl start ssh
So now we have WIFI configured and SSH enabled. That means next time when Raspberry Pi boots up it will connect to available WIFI network and you can SSH into it. You will not require LAN cable to connect to it anymore. But....
How do you know the IP address of your Pi after it restarts?
To know the IP address after you are logged in into Rasperry Pi, use below commands.
ssh firstname.lastname@example.org default password.
Purchase Raspberry Pi Starter Kit Here.