Skip to main content

Creating an SSH Key Pair

Generating an SSH key pair is essential for securely connecting to remote servers. This guide provides step-by-step instructions for generating an SSH key pair using the command line and PuTTygen for Windows.

Generating an SSH Key Pair on the Command Line

Using ssh-keygen

ssh-keygen is a tool for creating new authentication key pairs for SSH. Such key pairs are used for automating logins, single sign-on, and for authenticating hosts.

Creating an SSH keypair in Linux or macOS

  1. Generate the Private key:

    ssh-keygen -t rsa -b 4096 -f figure_identity
  2. View the Public key for pasting:

    cat figure_identity.pub

Creating an SSH keypair in Windows

  1. Download PuTTy Key Generator PuTTygen.exe file and run it.
  2. In the Key menu, select SSH-2 RSA Key
  3. In Parameters, select the RSA option.
  4. In Number of bits in generated key field, enter 4096
  5. In Actions, select Generate
  6. In the blank area under the progress bar, move your pointer in a random pattern to complete key pair generation.
  7. When generation completes, copy the contents of the Public key for pasting