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:
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.