How to Configure an SSH Key on an Existing Server
SSH lets you manage a server remotely from the command line, with the connection encrypted through port 22.
If the server is already deployed, you add the key from the section SSH Keys of the subscription, without recreating it.
👍 What you get
An active SSH key on a server already up and running, and the private key in your possession to connect securely.
❗️ Activating the key restarts the server
Unlike configuring it during setup, activating an SSH key on an existing server restarts the machine and generates a new password.
Do it in a window where you can accommodate that restart, not in full production.
How the key pair works
SSH uses two pieces that go together: the public key stays on the server and you keep the private key. The private one is what identifies you when connecting, so it isn't shared. You can find more details in How to configure an SSH key on a new server.
Public key
On the server
Verifies who connects
Private key
On your computer
Identifies you when connecting; not shared
Before you start
Be registered on the Plenit platform and have permission to manage servers.
Have a server deployed in a subscription of Servers.
Be able to tolerate a server restart during activation.
Step 1. Go to the SSH Keys section
Go to the subscription of Servers from its card.
In the right-hand side submenu, open SSH Keys.
Click Create SSH Key.
{/* 📸 CAPTURE 1 · side submenu with "SSH Keys" and the Create SSH Key button */}

Step 2. Create and activate the key
Enter a name for the key.
Check Generate a new key.
Select the servers where you want to activate it.
Click Continue.
The platform warns that activating the key restarts the server and generates a new password. Click Confirm to continue. The restart and key generation begin.
{/* 📸 CAPTURE 2 · key dialog with "Generate a new key" and the selection of servers */}

❗️ Save the private key and password: they are shown only once
During the process, two pieces of data appear that cannot be consulted again. Copy and save them as soon as you see them:
The private key SSH. Click Confirm after copying it.
The new password of the server. Click Confirm after copying it.
Step 3. Connect with the key
Save the private key in a file and protect it: SSH rejects a 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 for connecting is determined by the server's operating system. If you're not sure, confirm it based on the deployed image.
If something does not fit
The server restarted without warning anyone
Activation restarts the machine
Plan activation in a maintenance window
You don't have the private key or the password
They were shown only during the process and were not saved
Create a new key; another password will be generated
SSH rejects the key due to permissions
The private key is accessible to other users
Apply chmod 600 (Linux) or icacls (Windows)
Last updated
Was this helpful?

