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
-
Generate the Private key:
ssh-keygen -t rsa -b 4096 -f figure_identity
-
View the Public key for pasting:
cat figure_identity.pub
Creating an SSH keypair in Windows
- Download PuTTy Key Generator PuTTygen.exe file and run it.
- In the Key menu, select SSH-2 RSA Key
- In Parameters, select the RSA option.
- In Number of bits in generated key field, enter 4096
- In Actions, select Generate
- In the blank area under the progress bar, move your pointer in a random pattern to complete key pair generation.
- When generation completes, copy the contents of the Public key for pasting