How to Create an SSH Key
A quick guide on generating SSH keys for secure server access.
What is an SSH Key?
An SSH (Secure Shell) key is an access credential that is used in the SSH protocol. It is much more secure than traditional password authentication and is the standard way to securely log into virtual private servers (VPS) and access cloud infrastructure.
Step 1 — Generate the Key Pair
You can generate an SSH key from the terminal (Mac/Linux) or Command Prompt/PowerShell (Windows 10/11). Open your terminal and run the following command:
1ssh-keygen -t ed25519 -C "your_email@example.com"Note: If you are using an older system that doesn't support ED25519, use ssh-keygen -t rsa -b 4096 instead.
Save the File
When prompted with "Enter a file in which to save the key," press Enter to accept the default location (usually ~/.ssh/id_ed25519).
Set a Passphrase (Optional)
You will be asked to enter a passphrase. While optional, it adds an extra layer of security. If you type a password, you won't see any characters on the screen as you type. If you prefer not to use a password, simply press Enter twice.
Step 2 — Get Your Public Key
Your key pair consists of a private key (which you should never share) and a public key (which you add to servers you want to access).
To view your public key, run the following command in your terminal:
1cat ~/.ssh/id_ed25519.pubThis will output a line starting with ssh-ed25519 followed by a long string of characters.Copy this entire line. You will paste this into your VPS provider's control panel (like Cherry Servers) when spinning up a new server.
cat might not be available. You can open the file manually located at C:\Users\YourUsername\.ssh\id_ed25519.pub using Notepad to copy its contents.Step 3 — Log into Your Server
Once your server is provisioned with your public key, you can log in directly using its IP address without needing a password:
1ssh root@your_server_ipIf this is your first time connecting, you may be asked to verify the host key fingerprint. Type yes and press Enter.