How to Configure an SSH Key on a New Server
SSH lets you administer a server remotely from the command line, with the connection encrypted through port 22.
Instead of a password, it uses a pair of keys: you create the key during server setup and then connect with it later.
👍 What you get
A server created with its associated SSH key, and the private key in your possession to connect securely.
How the key pair works
SSH works with two pieces that go together: a public key and a private key. The public one stays on the server; the private one is kept by you and is what proves your identity when connecting.
That is why a key is more secure than a password: it doesn't travel, it can't be guessed, and it isn't reused across services.
Public key
On the server
Verifies who connects
Private key
On your computer
Identifies you when connecting; it is not shared
Before you begin
Be registered on the Plenit platform.
Have permission to create servers.
Be creating a server in a subscription of Servers (the key is configured in the last step of the wizard).
Step 1. Generate the key when creating the server
In the last window of the wizard (the one for Name):
Enter the name of the server.
In Choose an SSH key, click the button +.
In the window that opens, enter a name for the key, check Generate a new key and click Add.
{/* 📸 SCREENSHOT 1 · field "Choose an SSH key" with the + button and the key generation dialog */}

❗️ The private key is shown only once
When you add it, the platform shows you the private key. Copy it and save it somewhere safe at that moment: it cannot be viewed again. If you lose it, generate a new one.
Copy the private key and click Confirm.
Back in the wizard, the field Choose an SSH key is left with the newly created key. Click Create server.
{/* 📸 SCREENSHOT 2 · wizard with the selected key and the Create server button */}

Step 2. Connect with the key
Save the private key in a file and protect it: SSH rejects a private key with permissions that are too open.
On Linux or macOS:
On Windows, with the OpenSSH client from PowerShell:
📘 The user depends on the image
The username used to connect is determined by the server operating system. If you're not sure, confirm it according to the image you deployed.
If something doesn't fit
SSH rejects the key due to permissions
The private key is accessible to other users
Apply chmod 600 (Linux) or icacls (Windows)
You do not have the private key
It was only shown when it was created and was not saved
Generate a new key and associate it with the server
The connection is rejected
Incorrect user for that image
Use the user that corresponds to the operating system
Next steps
Last updated
Was this helpful?

