Raspberry Pi: Cybersecurity Edition - First Boot (Headless)

Raspberry Pi First Boot (Headless)

In this tutorial, we will be setting up a Raspberry Pi in a "headless" configuration, which means that you won’t need to connect it to a monitor, mouse, or keyboard. Instead, we’ll be using two network protocols: SSH and VNC, for securely transmitting text and video information, respectively.
Installing Raspian for the first time
- Flash your Raspberry Pi using the official Raspberry Pi Burner
- To enable SSH, create a blank file named ssh in the root directory of the burned card.
- Create a file named wpa_supplicant.conf and paste the following text into it, updating it with your real Wi-Fi information:
# Set the country code to US for wireless regulations
country=US
# Set the directory where the wpa_supplicant control interface will be created
# and set the group ownership to netdev
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
# Allow wpa_supplicant to modify the configuration file
update_config=1
# Configure a network block for a wireless network with the given SSID and PSK
network={
ssid="your_internet" # Replace "your_internet" with the actual SSID of your wireless network
psk="your_password" # Replace "your_password" with the actual pre-shared key (password) of your wireless network
}
- Safely eject the microSD card and insert it into your Raspberry Pi
- Connect the Raspberry Pi to the power source and wait a few minutes for it to fully boot up.
- Determine the Raspberry Pi’s IP address by using a tool like LanScan Free and look for a device with the hostname
raspberrypi. Write down the IP address.
- In Terminal on your Mac, enter ssh pi@[IP_ADDRESS], replacing [IP_ADDRESS] with the IP address of your Raspberry Pi. The default username is pi and the password is raspberry.
- In Terminal, type
sudo raspi-configto open the Raspberry Pi Configuration Program with administrative privileges.
Configuring Raspberry Pi for the first time
If the Pi is booting succesfully, then that means it’s time to configure!
- After you have logged in to the raspberry pi using SSH, type
raspi-configand you should see something that looks like this:
- There are a number of screens that we encourage you to explore, however there are only a few that we are concerned with for our first boot.Use the
up,down, andenterkeys here to navigate
Raspberry Pi First Boot (Headless)
-
Change User Password
- Select "Change User Password" from the main menu.
- The current password is
raspberry. Type a new password that you will remember, and then type it again when prompted.
-
Boot Options
- Select "Boot Options" from the main menu.
- Select B1: Desktop / CLI and then choose B4: Desktop Autologin from the next menu.
-
Interfacing Options
- Select "Interfacing Options" from the main menu.
- Select VNC and then select Yes to turn it on.
- Note: SSH is already turned on by default.
-
Advanced Options
- Select "Advanced Options" from the main menu.
- Select A1: Expand Filesystem and then select A5: Resolution DMT85.
-
Finish
- Select "Finish" from the main menu.
-
Reboot
- Select "Yes" to reboot the Raspberry Pi.
Use VNC Viewer to connect to your Raspberry Pi
To connect to your Raspberry Pi using VNC:
- Download and install VNC Viewer from RealVNC.
- Open VNC Viewer, click File > New Connection, enter the IP address and name of your Pi, and press OK.
- Enter the password and save it. You should see the following image:
- Double-click "Raspie", and you may see an error message regarding hosts. Enter your password and hit save.
- Follow through the prompts, including pressing OK to the SSH warning, filling out your Country, Language, and Timezone, entering a new password, and clicking Next through the remaining steps. Make sure to skip adding Wi-Fi. When prompted to update software, click Next. This will download all the software and you can then click reboot.
You’re done!
Congratulations, you have successfully booted up a headless Raspberry Pi and logged in through VNC.

