Generating SSH keys
On the macOS, Linux, or UNIX operating systems, you use the
ssh-keygencommand to create an SSH public key and SSH private key also known as a key-pair.
To create SSH keys on a macOS, Linux, or UNIX operating system
- 1.On macOS, Linux, or UNIX operating systems, open a command terminal.
- 2.At the prompt, enter the following command:
The following shows an example of the
3. Navigate to the
key_name.pub file and open it.
4. Copy the text and paste it in SSH public key.
Windows uses a slightly different SSH key-pair format. The public key must be in the
PUBformat, and the private key must be in the
PPKformat. On Windows, you can use PuTTYgen to create an SSH key-pair in the appropriate formats. You can also use PuTTYgen to convert a private key generated using
ssh-keygento a .ppk file.