Installing Ubuntu Core 24 on Raspberry Pi 5: SSH Setup and First-Time Boot
Installing Ubuntu Core 24 on Raspberry Pi 5: SSH Setup and First-Time Boot
Introduction
Ubuntu Core is a secure, lightweight version of Ubuntu designed for IoT devices like the Raspberry Pi. While the initial setup requires a monitor and keyboard, after that, you can run the system entirely headless, accessing it remotely via SSH. In this guide, we'll walk you through installing Ubuntu Core, generating an SSH key, and setting up your Raspberry Pi for remote access.
What You’ll Need:
- A Raspberry Pi (model 3, 4, or 5)
- A microSD card (4GB or larger)
- A computer with a microSD card reader, or a USB card reader
- A monitor and keyboard for the initial set
- An Ubuntu SSO account with your SSH key added (instructions below)
Step 1: Generate an SSH Key
Before starting, you'll need to generate an SSH key pair. This key pair will be used to securely connect to your Raspberry Pi after the setup.
On Linux and macOS:
1. Use the Terminal application and run the following:
2. When prompted, press Enter to save the key in the default location: ~/.ssh/id_rsa.
3. You can add a passphrase or leave it empty (press Enter again to skip).
4. Your public key will be saved in ~/.ssh/id_rsa. You’ll need this later to link with your Ubuntu SSO account.
On Windows:
1. Use the built-in OpenSSH client in Windows PowerShell or a tool like PuTTY.
2. In PowerShell, run the following:
3. Follow the same steps as for Linux and macOS. The key will be saved in your user directory at: C:\Users\YourUsername\.ssh\id_rsa.pub.
Step 2: Create an Ubuntu SSO Account and Add Your SSH Key
Next, create an Ubuntu SSO account if you don't have one:
1. Visit the [Ubuntu SSO page] and sign up.
2. After signing up, go to your account settings and upload your public SSH key (id_rsa.pub) from the previous step. This key will be used to authenticate your connection to the Raspberry Pi.
Step 3: Write Ubuntu Core Image to a MicroSD Card
To install Ubuntu Core on your Raspberry Pi, use the Raspberry Pi Imager:
1. Download and install Raspberry Pi Imager from Raspberry Pi.
2. Open the Imager, click Choose OS, scroll to Other general-purpose OS, and select Ubuntu Core 24 (64-bit).
3. Select Choose Storage, insert your microSD card, and confirm the selection.
4. Click Write, and the Imager will download and write the image to your card.
5. Once finished, remove the microSD card and insert it into your powered-off Raspberry Pi.
Step 4: Booting Ubuntu Core for the First Time
Now, it's time to boot your Raspberry Pi:
1. Connect a monitor and keyboard, insert the microSD card, and power on the Raspberry Pi.
2. Wait for about five minutes for the system to initialize. You’ll see typical Linux boot messages on the screen.
3. When prompted, press Enter to configure the device.
4. Set up your network connection (Wi-Fi or Ethernet).
Once the network is successfully configured, the IP address of your Raspberry Pi will be displayed next to DHCPv4 on the network connections screen. Make a note of this IP address, as you will need it later for SSH access.
Step 5: Enter Your Ubuntu SSO Account
After connecting to the network, you’ll be asked to enter your Ubuntu SSO email. This links the Raspberry Pi to your SSO account and pulls in your public SSH key.
1. Enter the email address associated with your Ubuntu SSO account.
2. Ubuntu Core will automatically retrieve your SSH key, and you’ll see a confirmation message that your device is registered to your SSO account.
Step 6: Access Your Raspberry Pi Remotely
Once setup is complete, you can now access your Raspberry Pi headlessly via SSH from your computer:
1. Open a terminal (or SSH client on Windows).
2. Use the following command to connect:
Replace <username> with your Ubuntu SSO username and <device-ip-address> with the IP address of your Raspberry Pi (shown on the screen during the setup).
Congratulations!
Your Ubuntu Core device is now ready to use, and you can manage it remotely via SSH. No need for a monitor or keyboard anymore—you’re all set for headless operation. Ubuntu Core will automatically keep your device updated and secure, making it perfect for IoT and embedded projects.
Source: Ubuntu - Install Ubuntu Core with Raspberry Pi Imager
Image: ADMC from Pixabay
Comments
Post a Comment