Leon Anavi
IT Tips && Tricks

Mobile & Embedded

Created: 24.01.2025 07:01 Last Modified: 24.01.2025 07:01 Views: 114
Keywords: core-image-base, dropbear, Linux, network, OpenEmbedded, Poky, Raspberry Pi 5, Scarthgap, SSH, systemd, Yocto, bitbake

Enable SSH for Remote Network Access on Raspberry Pi 5 with the Yocto Project

This is the second tutorial in a series about using the Yocto Project and OpenEmbedded with Raspberry Pi 5. In the first tutorial, we covered how to get started with the Yocto Project and build core-image-minimal from scratch using the Poky Linux distribution. Now, we will take things a step further by enabling SSH in the same core-image-base, allowing you to remotely access and manage your embedded Linux systems securely.

SSH (Secure Shell) is a cryptographic network protocol used in client-server architecture to simplify remote device management. With SSH, developers can execute commands, transfer files, and debug systems securely. Including SSH functionality in your Yocto-built image ensures seamless interaction with your devices during development and beyond.

Steps to Add SSH to a Yocto Project Image

Follow these instructions to include an SSH server in your image:

1. Initialize the Build Environment

Navigate to the directory where your core-image-base was built, as shown in episode 1 of this tutorial series. Then, initialize the build environment by running:

source oe-init-build-env

2. Update the Configuration File

Open the conf/local.conf file in your build directory and append the following line to include the Dropbear SSH server in your image:

EXTRA_IMAGE_FEATURES:append = " ssh-server-dropbear"

3. Verify Configuration Changes

Ensure the EXTRA_IMAGE_FEATURES variable contains the necessary addition by using the bitbake-getvar command:

bitbake-getvar EXTRA_IMAGE_FEATURES

This command displays the current value of the EXTRA_IMAGE_FEATURES variable, allowing you to confirm that "ssh-server-dropbear" has been successfully added.

4. Build the Image

Once the configuration is verified, build the image using the following command:

bitbake core-image-base

Demonstration on Raspberry Pi 5

The tutorial video demonstrates how to enable and use SSH on a Raspberry Pi 5 running core-image-base, built with the Yocto Project LTS release, Scarthgap. With SSH enabled, developers can easily manage and debug their Raspberry Pi remotely.

Why Dropbear for SSH?

The Dropbear SSH server is lightweight and well-suited for embedded systems with constrained resources, making it an excellent choice for embedded Linux projects. By including it in your image, you ensure a balance between functionality and efficiency.

Conclusion

Enabling SSH in an image built with The Yocto Project and OpenEmbedded enhances your ability to manage embedded Linux systems remotely. By following the steps outlined above, you can easily add and configure the Dropbear SSH server to your image. For a visual walkthrough, refer to the accompanying tutorial video showcasing the process on a Raspberry Pi 5.

Stay tuned for the next tutorial in this series, where we will explore more advanced features. May the open source be with you and happy coding!



  Home | About | Contact | Disclaimer | Sitemap © 2009-2022 Leon Anavi. All rights reserved.