Generate an SSH key pair and connect to hosting or VPS
- 20.02.2026 00:58
-
- hosting
- ssh
- vps
Using SSH keys is the recommended way to access a server because it is more secure than password authentication. An SSH key pair contains:
- Public key – safe to upload to Plesk/VPS
- Private key – stays on your device (never share it)
Generate an SSH key pair
Option A – macOS / Linux
- Open Terminal.
- Run:
ssh-keygen -t ed25519 -C "your-email@example.com" - Press Enter to accept the default path (
~/.ssh/id_ed25519). - Set a strong passphrase (recommended).
Your public key will be in ~/.ssh/id_ed25519.pub.
Option B – Windows 10/11 (PowerShell)
- Open PowerShell.
- Run:
ssh-keygen -t ed25519 -C "your-email@example.com" - Save to the default location (usually
C:\Users\<User>\.ssh\). - Set a passphrase (recommended).
The public key is the file ending with .pub.
Option C – Windows (PuTTYgen)
- If you use PuTTY, you can generate keys with PuTTYgen and export a private key in
.ppkformat.
Add the public key
Add the key to GARMTECH Hosting (Plesk)
- Log in to Plesk (open from My.GARMTECH).
- Open the section for SSH access / SSH Keys (location may vary by hosting plan).
- Paste the contents of your
.pubfile and save.
Add the key to a Linux VPS
- Connect to the VPS (initially you may use a password).
- Add your public key to the user’s
~/.ssh/authorized_keysfile. - Ensure permissions are correct:
chmod 700 ~/.ssh chmod 600 ~/.ssh/authorized_keys
Connect via SSH
Use the correct username and host:
- Hosting: use the server hostname and SSH username from your service details in My.GARMTECH/Plesk.
- VPS: use the VPS IP address and the Linux user (often
rootfor initial access).
Example command:
ssh username@server-hostname
Troubleshooting
- Permission denied: make sure you uploaded the public key, and you are connecting with the correct username.
- Wrong key used: specify the key explicitly:
ssh -i ~/.ssh/id_ed25519 username@server-hostname - Do not share private keys: if your private key is exposed, generate a new key pair immediately.
Related Articles
Comments
Add Comment