Important changes to Tiny Cloud pricing > Find out more

NOTE: TinyMCE 5 reached End of Support in April 2023. No more bug fixes, security updates, or new features will be introduced to TinyMCE 5. We recommend you upgrade to TinyMCE 6 or consider TinyMCE 5 Long Term Support (LTS) if you need more time.

Creating a private/public key pair for Tiny Cloud

Instructions on how to generate private/public key pairs for the Tiny Cloud

Contribute to this page

The procedure for creating a key pair depends on the operating system of the host machine.

Linux

To create a private/public key pair on a Linux operating system:

  1. Install OpenSSL.
  2. Create a private/public key pair.
  3. Retrieve the public key.

Installing OpenSSL on Linux

The procedure for installing OpenSSL on Linux distributions varies. The installation commands for common Linux distributions have been provided here.

Red Hat Enterprise Linux 7 or CentOS 7

On a command line, run the following commands to install OpenSSL on:

  • Red Hat Enterprise Linux 6 or 7.
  • CentOS 6 or 7.
sudo yum check-update
sudo yum install openssl

Red Hat Enterprise Linux 8+, Fedora, or CentOS 8+

On a command line, run the following commands to install OpenSSL on:

  • Red Hat Enterprise Linux 8 or later.
  • CentOS 8 or later.
  • Fedora 18 or later.
sudo dnf check-update
sudo dnf install openssl

Debian, Ubuntu, Linux Mint, or other Debian-based distributions

On a command line, run the following commands to install OpenSSL on Debian-based operating systems (such as: Debian, Ubuntu, and Linux Mint).

sudo apt update
sudo apt install openssl

SUSE Linux Enterprise Server or openSUSE

On a command line, run the following commands to install OpenSSL on openSUSE-based operating systems (such as: openSUSE and SUSE Linux Enterprise Server).

sudo zypper refresh
sudo zypper install openssl

Create a private/public key pair on Linux

To create a private/public key pair:

  1. On a command line, run:

     ssh-keygen -m PEM -t rsa -b 2048 -f <MY_KEY_PAIR_NAME>
    

    Where <MY_KEY_PAIR_NAME> should be replaced with a name for the key pair.

  2. (Optional) Enter a passphrase for accessing the private key.

    Important: Some libraries used for generating JWTs do not support private keys encrypted with a passphrase. When passphrases are not supported, leave the passphrase blank or include -N "" option for the ssh-keygen command.

Two files will be created in the current directory:

  • <MY_KEY_PAIR_NAME> - The private key.
  • <MY_KEY_PAIR_NAME>.pub - The public key.

Retrieve the public key on Linux

To retrieve the public key, on a command line, run:

openssl rsa -in <MY_KEY_PAIR_NAME> -outform DER -pubout | base64 -w0

The public key for the <MY_KEY_PAIR_NAME> key pair will be printed on the command line with base64 encoding.

Apple macOS

To create a private/public key pair on a macOS operating system:

  1. Create a private/public key pair.
  2. Retrieve the public key.

Create a private/public key pair on macOS

To create a private/public key pair:

  1. Using Finder, open a Terminal.
  2. On a terminal, run:

     ssh-keygen -m PEM -t rsa -b 2048 -f <MY_KEY_PAIR_NAME>
    

    Where <MY_KEY_PAIR_NAME> should be replaced with a name for the key pair.

  3. (Optional) Enter a passphrase for accessing the private key.

    Important: Some libraries used for generating JWTs do not support private keys encrypted with a passphrase. When passphrases are not supported, leave the passphrase blank or include -N "" option for the ssh-keygen command.

Two files will be created in the current directory:

  • <MY_KEY_PAIR_NAME> - The private key.
  • <MY_KEY_PAIR_NAME>.pub - The public key.

Retrieve the public key on macOS

To retrieve the public key, on a terminal, run:

openssl rsa -in <MY_KEY_PAIR_NAME> -outform DER -pubout | base64 -

The public key for the <MY_KEY_PAIR_NAME> key pair will be printed on the terminal with base64 encoding.

Microsoft Windows

To create a private/public key pair on a Microsoft Windows operating system:

  1. Install OpenSSL.
  2. Create a private/public key pair.
  3. Retrieve the public key.

Installing OpenSSL on Microsoft Windows

To install OpenSSL with Git for Windows:

  1. Download the Windows package from the Git Downloads page.
  2. Open the downloaded file Git-<VERSION>-<ARCH>-bit.exe, where <VERSION> is the latest version of Git for Windows and <ARCH> is the architecture, such as 32-bit or 64-bit.
  3. Click Next on the Information and Select Destination Location screens.
  4. Select Check daily for Git for Windows updates on the Select Components screen, then click Next.
  5. Click Next on the remaining screens to accept the default settings.
  6. Once the installation is complete, click Finish.

Create a private/public key pair on Windows

To create a private/public key pair:

  1. Open the Start menu (or Windows menu) and open Git Bash.
  2. On the Git bash command line, run:

     ssh-keygen -m PEM -t rsa -b 2048 -f <MY_KEY_PAIR_NAME>
    

    Where <MY_KEY_PAIR_NAME> should be replaced with a name for the key pair.

  3. (Optional) Enter a passphrase for accessing the private key.

    Important: Some libraries used for generating JWTs do not support private keys encrypted with a passphrase. When passphrases are not supported, leave the passphrase blank or include -N "" option for the ssh-keygen command.

Two files will be created in the current directory:

  • <MY_KEY_PAIR_NAME> - The private key.
  • <MY_KEY_PAIR_NAME>.pub - The public key.

Retrieve the public key on Windows

To retrieve the public key, on a Git bash command line, run:

openssl rsa -in <MY_KEY_PAIR_NAME> -outform DER -pubout | base64 -w0

The public key for the <MY_KEY_PAIR_NAME> key pair will be printed on the command line with base64 encoding.

Can't find what you're looking for? Let us know.

Except as otherwise noted, the content of this page is licensed under the Creative Commons BY-NC-SA 3.0 License, and code samples are licensed under the Apache 2.0 License.