Configure SSH for remote Build and Run on Embedded Linux
Configure SSH key-based access and Build Profile remote machine settings for Build and Run.
Read time 2 minutesLast updated a month ago
Configure Secure Shell (SSH) key-based access so Unity can connect to a remote Embedded Linux device and launch your Player with Build and Run.
Prerequisites
Before you begin:
- Install Unity with Embedded Linux Build Support.
- Confirm you can reach the target device over the network.
- Confirm the target device has an SSH server running.
Configure SSH access for the target device
To generate an SSH key and configure host mapping:
-
Generate a new SSH key pair with a unique file name:ssh-keygen -t ed25519 -f ~/.ssh/unity_embedded_linux_key -C "unity-embedded-linux-build"
-
Copy the public key to the target device:ssh-copy-id -i ~/.ssh/unity_embedded_linux_key.pub <remote-user>@<ip-address>
-
Add a host entry in your localfile:
~/.ssh/configHost MYMACHINEHostName <ip-address>User <remote-user>StrictHostKeyChecking accept-newIdentityFile ~/.ssh/unity_embedded_linux_keyHost MYMACHINE HostName <ip-address> User <remote-user> StrictHostKeyChecking accept-new IdentityFile ~/.ssh/unity_embedded_linux_key Port <port> -
Verify the SSH mapping:ssh MYMACHINE
After you complete these steps, SSH logs you in directly to the remote home directory. If login fails, refer to Troubleshoot SSH connection issues.
Configure remote device settings in the Build Profiles window
To configure Unity to use the SSH host mapping:
- Open the Build Profiles window.
- Select your Embedded Linux build profile.
- In Platform Settings > Remote Device, set Address to .
MYMACHINE - Leave Username blank.
- Set Install Path to a valid path on the remote device.
- Select Build and Run.
Unity builds the Player, copies it to the target device, and launches it remotely. If the build or launch fails, refer to Troubleshoot SSH connection issues.
Troubleshoot SSH connection issues
Use the following list to troubleshoot SSH connection issues:
- If authentication fails, check that the public key is in on the target device and that file permissions are valid.
~/.ssh/authorized_keys - If connection fails, verify the host alias, IP address, and optional value in
Port.~/.ssh/config - If deployment succeeds but launch fails, verify Install Path points to a writable and executable location on the target device.
- If the Player doesn’t start, make sure all required export variables are set in Remote Device > Exports in the Embedded Linux Build Profiles window. For more information, refer to Embedded Linux build settings reference.