Overview
This article will cover how to create SSH keys for Mac, Windows, and Linux. Once you create your key, you can then add your public key to your my.pressable.com account to access SSH without needing to enter a password (more info here).
This article will cover how to create SSH keys for Mac, Windows, and Linux. Once you create your key, you can then add your public key to your my.pressable.com account to access SSH without needing to enter a password (more info here).
Public key type: ecdsa-sha2-nistp256 keys of 256 bits
You can generate your SSH key from macOS terminal by following the steps below:
ssh-keygen -t rsa
When you execute the command, the ssh-keygen utility prompts you to enter the name of the file you want the key to be stored in. The name of the key can be entered without any extension like for ex. id_rsa_public_key.
Type in a passphrase when prompted. You can hit the ENTER key to accept the default (empty for no passphrase). However, it is recommended to always use a passphrase when generating your public key for security reasons.
Enter the passphrase for the second time to continue, the terminal will generate the key pair automatically.
To see the generated key files you can run ls
command to see a list of files inside the directory.
Note: A pair of keys (public and private) will be generated and saved in the directory where the command was initiated, both files will have identical names. However, you can differentiate both files by looking out for the key with .pub extension for ex. id_rsa_public_key.pub
To view the content of the key file from terminal, run this command cat id_rsa.public_key.pub
the public key should look similar to this:
The content of the file can be copied to the clipboard by running this command: pbcopy < ~/.ssh/id_rsa.public_key.pub
For security reasons, only the following key types and lengths are allowed
To generate your SSH keys on Windows follow the steps below:
ssh-keygen
ssh-keygen -t ecdsa
to generate a ecdsa-sha2-nistp256 keys of 256 bitsvarsh
replaced by your username: Get-Content id_rsa.pub
For security reasons, only the following key types and lengths are allowed
Public key type: ecdsa-sha2-nistp256 keys of 256 bits
Ubuntu’sssh
implementation of the rsa
algorithm is not be fully supported by Pressable, however the ed25519
algorithm should work just fine. A Public key can be generated for Linux debian distribution with the following steps below:
ssh-keygen -t ed25519
When you execute the command, the ssh-keygen utility prompts you to enter the name of the file you want the key to be stored in. The name of the key can be entered without any extension like for ex. id_ed25519. Leaving the name blank will generate a default name and put the file within your ~/.ssh
directory
Type in a passphrase when prompted. You can hit the ENTER key to accept the default (empty for no passphrase). However, it is recommended to always use a passphrase when generating your public key for security reasons.
Enter the passphrase for the second time to continue, the terminal will generate the key pair automatically.
To see the generated key files you can run ls
command to see a list of files inside the corresponding directory. In this case, the key was stored within the .ssh
directory.
For security reasons, only the following key types and lengths are allowed