A couple of months ago, I bought a Raspberry Pi 3 B+. To be honest, I couldn’t find usage for it and it was laying around for some time. Then, I discovered some projects to work with it. I wanted to use it with SSH and also wanted to use the internal Wi-Fi abilities as well. So, in this post, I will explain how you can set up yours and work via SSH. Let’s begin!
What do we need?
For this process, you need these following:
- Raspberry Pi and power supply (of course)
- An SD Card to burn the image in it.
- Raspbian Image of your favorite. I will go with “Raspbian Buster Lite”. You can download them from here.
- An ISO burner software. I’ll use Balena Etcher in this tutorial. You can download it from here.
- An SSH client. Can be built-in terminal for Linux and Mac, or PuTTY for Windows.
Preparing the SD card
First of all, download the necessary tool and image to prepare our SD Card. Then go to your software and burn the image to the SD Card.
Configuring the SD card
Then, we need to go to the SD card location. I am using terminal here to browse around. When we arrive to the “/boot” folder, which is our SD card should named, we will run these two lines in there.
touch ssh
touch wpa_supplicant.conf
Editing the wpa_supplicant.conf
Now, we need to edit the contents of the wpa_supplicant.conf. In order to achieve this, you can use your preferred text editor. Just copy and paste following there and edit with your own values and save it.
country=<Insert 2 letter ISO 3166-1 country code here. Ex. GB, US, TR, EE>
update_config=1
ctrl_interface=/var/run/wpa_supplicant
network={
ssid="My Wi-Fi"
psk="MyPassword"
key_mgmt=WPA-PSK
}
You are ready to boot your Raspberry Pi! Just plug the SD card and boot the machine. Wait a little bit and you are ready to connect it via SSH. You can connect it with the assigned IP of Raspberry Pi. There is an easier solution!
Connecting with SSH
If you are in the same network with the Raspberry Pi. You can login as the following:
ssh [email protected]
It should ask for fingerprint validation if you are logging in for first time. Write “yes” and press enter. The default password for the pi user is raspbian.
There you have it! You make your SSH connection to your Raspberry Pi and it is working headless.
Bonus Tip
I am working in a homelab project which I will write about soon in here. But I want to mention, as a bonus in here. For the lab, I am running my Wi-Fi router as a “Hidden Network”. In order to connect hidden networks with Raspberry Pi. You need to add this line to the your “network” section in the wpa_supplicant.conf
scan_ssid=1
So, at the end it should look like this.
country=<Insert 2 letter ISO 3166-1 country code here. Ex. GB, US, TR, EE>
update_config=1
ctrl_interface=/var/run/wpa_supplicant
network={
ssid="My Wi-Fi"
scan_ssid=1
psk="MyPassword"
key_mgmt=WPA-PSK
}
Closing notes
I hope you liked what you read and I am really looking forward to seeing you in the next one! If you don’t want to miss any content, you can subscribe to the website and I will let you know whenever something new going on here!
Also you can reach out to me from the “Contact” section. Feel free to share your thoughs or suggest any ideas. I am reading all the messages and I will reply yours as soon as possible!
As you might know me, I like coffee and high-quality content. If you want to support me and my effort, why not a little caffeine boost ha? 😎
Until next one,
Furkan