Creating a private/public key pair for Tiny Cloud
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:
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
Create a private/public key pair on Linux
To create a private/public key pair:
-
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. -
(Optional) Enter a passphrase for accessing the private key.
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 thessh-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.
Apple macOS
To create a private/public key pair on a macOS operating system:
Create a private/public key pair on macOS
To create a private/public key pair:
-
Using Finder, open a Terminal.
-
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. -
(Optional) Enter a passphrase for accessing the private key.
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 thessh-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.
Microsoft Windows
To create a private/public key pair on a Microsoft Windows operating system:
Installing OpenSSL on Microsoft Windows
To install OpenSSL with Git for Windows:
-
Download the Windows package from the Git Downloads page.
-
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. -
Click Next on the Information and Select Destination Location screens.
-
Select Check daily for Git for Windows updates on the Select Components screen, then click Next.
-
Click Next on the remaining screens to accept the default settings.
-
Once the installation is complete, click Finish.
Create a private/public key pair on Windows
To create a private/public key pair:
-
Open the Start menu (or Windows menu) and open Git Bash.
-
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. -
(Optional) Enter a passphrase for accessing the private key.
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 thessh-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.