Search

Generate an SSH Key Pair

Early Access: Ultra.sh is currently in early access. Features, plans, and documentation may change as we continue to improve the service. If anything here does not match what you see, open a support ticket and let us know.

Generate an SSH Key Pair

Generate an Ed25519 SSH key pair on Windows, macOS, or Linux. Keep the private key on your computer and add the public key to your VPS when you order it or later in the panel. This guide covers local key generation. You do not need to sign in to your account or connect to a VPS to create the keys.

Warning: Never share your private key or paste it into a website, support ticket, or chat. Only share the public key, which has a .pub file extension. Do not overwrite an existing key: other services may depend on it.

Prerequisites

  • Use the computer from which you plan to access your VPS.
  • Make sure the OpenSSH client tools, including ssh-keygen, are available. You do not need OpenSSH Server.
  • Follow the section for your operating system. Run all commands locally, not inside an SSH session to another server.

Generate the Key Pair

Windows

  • Open PowerShell from Start, or open Windows Terminal and select a PowerShell tab. PowerShell may open inside Windows Terminal automatically. Use your regular account. You do not need administrator privileges.
  • Follow these commands in PowerShell, not Command Prompt or WSL. The standard PowerShell prompt begins with PS.
  • Check that ssh-keygen is available:
Get-Command ssh-keygen
  • If a path appears, continue. If the command is not recognized, follow the Command Not Found steps under Troubleshooting below.
  • Create the .ssh folder in your user profile if it does not already exist. This command does not replace an existing folder:
if (-not (Test-Path "$env:USERPROFILE\.ssh")) {
    New-Item -ItemType Directory -Path "$env:USERPROFILE\.ssh" | Out-Null
}
  • Check whether either file with the proposed name already exists:
Test-Path "$env:USERPROFILE\.ssh\id_ed25519_ultrash"
Test-Path "$env:USERPROFILE\.ssh\id_ed25519_ultrash.pub"
  • Continue only if both results are False. Otherwise, choose an unused name, such as id_ed25519_ultrash_2, and use it in the checks and all remaining commands.
  • Generate the key pair:
ssh-keygen -t ed25519 -C "ultrash" -f "$env:USERPROFILE\.ssh\id_ed25519_ultrash"
  • Complete the prompts as described in Protect the Private Key below.

macOS and Linux

  • On macOS, open Terminal from Applications > Utilities. On Linux, open your desktop's terminal application. Use your regular user account; do not run the key generation commands with sudo.
  • Check that ssh-keygen is available:
command -v ssh-keygen
  • If a path appears, continue. If no path appears, follow the Command Not Found steps under Troubleshooting below.
  • Create the .ssh folder if it does not exist. The -m 700 option restricts a newly created folder to your user; this command does not change the permissions of an existing folder:
mkdir -p -m 700 "$HOME/.ssh"
  • Check whether either file with the proposed name already exists:
if [ -e "$HOME/.ssh/id_ed25519_ultrash" ] || [ -e "$HOME/.ssh/id_ed25519_ultrash.pub" ]; then
    printf '%s\n' 'A key file already exists. Choose a different name.'
else
    printf '%s\n' 'Neither key file exists. You can use this name.'
fi
  • If either file exists, choose an unused name, such as id_ed25519_ultrash_2, and use it in the check and all remaining commands.
  • Generate the key pair:
ssh-keygen -t ed25519 -C "ultrash" -f "$HOME/.ssh/id_ed25519_ultrash"
  • Complete the prompts as described in Protect the Private Key below.

Protect the Private Key

  • If ssh-keygen asks Overwrite (y/n)?, the file already exists. Enter n and press Enter, then repeat key generation with a different filename.
  • When ssh-keygen displays a prompt that begins with Enter passphrase, enter a strong, unique passphrase and press Enter. A passphrase encrypts your private key to help protect it if someone obtains the file.
  • Enter the same passphrase again at Enter same passphrase again:. No characters appear while you type. This is normal.
  • Pressing Enter without typing creates a private key without passphrase protection. Use a passphrase for better protection.
  • Keep the passphrase safe. It is separate from your Ultra.sh account password or VPS password, and it cannot be recovered from the key file if you forget it.
  • After successful generation, ssh-keygen displays the paths to both files, a fingerprint, and a randomart image. The fingerprint and randomart are not the public key to paste into the service.

Identify the Key Files

The commands above create these files in your user account's .ssh folder:

File
Purpose
id_ed25519_ultrash
Private key. Keep it protected on your computer and never share it.
id_ed25519_ultrash.pub
Public key. Copy its contents when a service requests your SSH public key.

-t ed25519 selects the key type, -f sets the private key's path, and -C "ultrash" adds an identification label. These commands do not change your SSH configuration or register the key with Ultra.sh.

Copy the Public Key

Windows

  • To view the public key, run:
Get-Content "$env:USERPROFILE\.ssh\id_ed25519_ultrash.pub"
  • To copy it directly to the clipboard instead, run:
Get-Content "$env:USERPROFILE\.ssh\id_ed25519_ultrash.pub" | Set-Clipboard

macOS and Linux

  • To view the public key, run:
cat "$HOME/.ssh/id_ed25519_ultrash.pub"
  • Copy the complete output line. On macOS, you can copy directly to the clipboard instead:
pbcopy < "$HOME/.ssh/id_ed25519_ultrash.pub"
  • On Linux, use your terminal's Copy action or copy the line from the .pub file in a text editor.

Check the Public Key

  • Copy the complete line beginning with ssh-ed25519, including the key data and the trailing comment. A terminal may wrap the line visually; do not insert additional line breaks.
  • Do not include the filename, fingerprint, randomart, or shell prompt.
  • Keep both files in a permanent location. You will need the private key when using the matching public key for SSH authentication. Keep access to the private key restricted to your user account.

Add the Public Key

  • When you order a VPS, paste the complete public key line into the SSH public key field. See Purchase a VPS.
  • To add the key to an existing VPS, open your server in the panel and go to Settings > Security > SSH Keys. Enter one key per line and click Save. The VPS must be running when you save. See Manage SSH Keys.

Your key pair is ready. Keep a record of the private key's path. SSH does not use a custom-named key such as id_ed25519_ultrash automatically, so pass it with the -i option when you connect:

  • macOS and Linux: ssh -i ~/.ssh/id_ed25519_ultrash -p 22 root@SERVER_IP
  • Windows PowerShell: ssh -i $env:USERPROFILE\.ssh\id_ed25519_ultrash -p 22 root@SERVER_IP

Replace SERVER_IP with the IP address of your VPS. If you cannot connect, see Troubleshooting SSH Connections.

Troubleshooting

Command Not Found

  • Windows: Install OpenSSH Client using the Microsoft installation instructions, then reopen PowerShell. Do not install OpenSSH Server.
  • Ubuntu/Debian: Only if ssh-keygen is missing, install the client tools with the commands below. Installation requires administrator privileges; key generation does not.
sudo apt update
sudo apt install openssh-client
  • Other Linux distributions: Use your distribution's package manager to install the OpenSSH client package.
  • macOS: Run ls -l /usr/bin/ssh-keygen. If the output lists the file, ssh-keygen is installed, so use /usr/bin/ssh-keygen in the generation command. If the output shows No such file or directory, ask your system administrator for help. Do not run Linux installation commands.

Other Issues

  • Passphrases do not match: Enter the same passphrase at both prompts. Watch for differences in capitalization and spacing.
  • Overwrite prompt: Enter n and generate the key with a new filename. Do not overwrite a key that another service may use.
  • Public key file not found: Check the saved path displayed by ssh-keygen. If you chose a different filename, update the display and copy commands to match it.

For more information about key generation and command options, see the official OpenSSH manual.

If you require further assistance, you can open a support ticket here.