An SSH key pair consists of a private key, which stays secret and goes into the platform, and a public key, which goes onto the server. You need one when you want to connect a server of your own to the platform.
1. Generate the key pair
Run this command in the terminal:
ssh-keygen -t ed25519 -C "application-platform" -f ~/.ssh/application-platform
Confirm the prompts with Enter. Afterwards, ~/.ssh contains the private key application-platform and the public key application-platform.pub.
2. Add the public key to the server
The quickest way is ssh-copy-id; replace the user and host with the values of your server:
ssh-copy-id -i ~/.ssh/application-platform.pub deploy@your-server.example.com
Without ssh-copy-id, append the contents of the .pub file by hand to the ~/.ssh/authorized_keys file of the user on the server.
Then check the login with the new key:
ssh -i ~/.ssh/application-platform deploy@your-server.example.com
If you land on the server without being asked for a password, the public key is in place. If the server still asks for a password, check whether you added the key to the right user.
3. Store the private key in the platform
-
In the platform, open Servers, click Add server, and choose SSH.
-
Print the contents of the private key file in the terminal:
cat ~/.ssh/application-platform -
Copy the complete output, including the
BEGINandENDlines, into the SSH private key field. -
Fill in the remaining fields as described under Your own server (SSH) and save.
~/.ssh folder and in the server entry of the platform. Never share it via chat or email, and never commit it to a repository.