Generate key#
SSH keys can be generated using the ssh-keygen
utility. The following table shows utility’s most useful parameters.
Option |
Description |
---|---|
|
Key type to create ( |
|
Number of bits in the key (e.g. |
|
Comment to add to the key (e.g. your email for GitHub). |
|
File in which to save the key (default: |
|
New passphrase for the key (empty string for no passphrase). |
|
Read a private key and print the corresponding public key. |
|
Show fingerprint of the given public/private key file. |
|
Fingerprint hash algorithm ( |
|
Change the passphrase of a private key. |
|
Remove all keys belonging to a hostname from |
|
Search |
|
Generate host keys of all types (used for SSH servers). |
|
Quiet mode – suppress most messages. |
Comment (
-C
)#The
-C
parameter allow you to set a comment that will be written to the public key file and can be used by third-party services.Note: Some guides recommend using your exact email address here, but you can use whatever you like.
The following cell generates the ssh key and adds “some arbitrary comment” to it.
The following cell prints ssh key generated in the previous code.
cat /tmp/ssh_experiments/my_super_key.pub
After the ssh key, write the exact comment specified in the
-C
option as raw text.