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.
Note: Have the device IP address or hostname and the SSH user name ready before you follow the steps below.
Before you begin:
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>
Note: If ssh-copy-id isn’t available, manually append the public key to ~/.ssh/authorized_keys on the target device.
Add a host entry in your local ~/.ssh/config file:
Host MYMACHINE
HostName <ip-address>
User <remote-user>
StrictHostKeyChecking accept-new
IdentityFile ~/.ssh/unity_embedded_linux_key
Note: If your SSH service uses a non-default port, add a Port line to the same host entry:
Host 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.
To configure Unity to use the SSH host mapping:
MYMACHINE.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.
Use the following list to troubleshoot SSH connection issues:
~/.ssh/authorized_keys on the target device and that file permissions are valid.Port value in ~/.ssh/config.