Skip to content

SSH Keys ​

You usually log in to a VPS with the root account and the password sent by your provider. Passwords carry two big risks: a leaked password means losing full control of the server, and attackers can guess passwords by brute force. That is why, on every server connected to FlashPanel, SSH password login is disabled by default; you log in with an SSH Key instead.

What is an SSH Key? ​

An SSH Key is a pair of keys used instead of a password for SSH logins:

  • Private key: stays on your computer and must never be shared.
  • Public key: a line of text starting with ssh-ed25519 ... or ssh-rsa ..., added to the server.

When you log in, the server checks that your computer holds the private key matching the public key that was added. Only someone with the private key can log in.

Some Windows software (PuTTY, WinSCP, some database tools) needs the private key in PuTTY (.ppk) format, while the ssh command and most other tools use the OpenSSH format. The guide below shows how to create both.

Generate SSH Key ​

Quick way: generate it in FlashPanel (any operating system) ​

  1. Open the SSH Keys page and click Add SSH Key.
  2. In the dialog, click Generate SSH Key. FlashPanel fills in the Name and Public key.
  3. Download all 3 files with the OpenSSH Key, PuTTY Key (.ppk), and Public Key (.pub) buttons, and keep them safe.
  4. Click Add SSH Key to save.

WARNING

The private key is issued only once. If you close the dialog without downloading it, you need to generate a new key.

Keys added on this page are Global SSH Keys: they are automatically added to every new server you create.

Windows ​

Using PowerShell (OpenSSH format)

Windows 10 (version 1809 or later) and Windows 11 usually include the OpenSSH Client. If ssh-keygen is not found, open Settings > System > Optional features (Windows 10: Settings > Apps > Optional features), click Add a feature (or View features), find OpenSSH Client, and click Install.

  1. Open PowerShell and run:

    powershell
    ssh-keygen -t ed25519

    Press Enter to save in the default location. You can enter a passphrase to protect the private key, or press Enter to skip.

  2. The command creates the private key id_ed25519 and the public key id_ed25519.pub in C:\Users\<your-name>\.ssh\. Show the public key to copy it:

    powershell
    Get-Content "$env:USERPROFILE\.ssh\id_ed25519.pub"

Using PuTTYgen (PuTTY .ppk format)

  1. Install PuTTY and open PuTTYgen.
  2. Under Type of key to generate, choose EdDSA (Ed25519) or RSA (2048 bits or more).
  3. Click Generate and move the mouse randomly over the blank area of the window until it finishes.
  4. (Optional) Enter a password for the private key in Key passphrase and Confirm passphrase.
  5. Click Save private key to save the .ppk file.
  6. Copy the entire content of the Public key for pasting into OpenSSH authorized_keys file box (starting with ssh-ed25519 or ssh-rsa). This is the public key to add to FlashPanel.

If you also need the private key in OpenSSH format, choose Conversions > Export OpenSSH key.

macOS ​

  1. Open Terminal and run:

    bash
    ssh-keygen -t ed25519

    Press Enter to save in the default location (~/.ssh/id_ed25519), then enter a passphrase or press Enter to skip.

  2. Copy the public key to the clipboard:

    bash
    pbcopy < ~/.ssh/id_ed25519.pub

If you need the private key in PuTTY (.ppk) format, install puttygen with Homebrew and convert it:

bash
brew install putty
puttygen ~/.ssh/id_ed25519 -o ~/.ssh/id_ed25519.ppk

Linux ​

  1. Open a terminal and run (if ssh-keygen is missing, install it with sudo apt install openssh-client):

    bash
    ssh-keygen -t ed25519

    Press Enter to save in the default location (~/.ssh/id_ed25519), then enter a passphrase or press Enter to skip.

  2. Show the public key to copy it:

    bash
    cat ~/.ssh/id_ed25519.pub

If you need the private key in PuTTY (.ppk) format:

bash
sudo apt install putty-tools
puttygen ~/.ssh/id_ed25519 -o ~/.ssh/id_ed25519.ppk

About key types ​

  • Ed25519 is short, fast, and secure, and is recommended in most cases.

  • If your software does not support Ed25519, generate an RSA key:

    bash
    ssh-keygen -t rsa -b 4096 -m PEM
  • If older software (old PuTTY or WinSCP versions) cannot open the .ppk file, convert with PPK version 2: add --ppk-param version=2 to the puttygen command, or in PuTTYgen choose Key > Parameters for saving key files... > PPK file version = 2 before saving.

Use SSH Keys with FlashPanel ​

Once you have a public key, add it to FlashPanel in one of two ways:

  • Global SSH Keys: tied to your account and automatically added to every new server.
  • Server SSH Keys: added for a specific system user on an existing server.

Then log in with the matching private key, for example:

bash
ssh -i ~/.ssh/id_ed25519 flashpanel@SERVER_IP

Server SSH Key ​

Besides your own SSH Key, each server has its own SSH key pair, created by FlashPanel during setup. The server uses this key to pull code from private Git repositories (GitHub, GitLab, Bitbucket...), for example when deploying a website.

To add the server's public key to your Git account:

  1. Open the server's Home page and, in the Utilities group, click Add Server SSH Key.
  2. Select the connected Git accounts and click Submit.
  3. For providers that don't support adding keys automatically, click the copy button for Server Global SSH Key and add it yourself on the provider's SSH key page shown in the hint.