Thursday, 10 September 2020

How to generate SSH key pair on Ubuntu

ssh-keygen -t rsa -b 4096 -C ""

-t Specifies the type of key to create.  The possible values are “dsa”, “ecdsa”, “ed25519”, or “rsa”.

-C comment Provides a new comment. This can be any string you want to help identify the key. As this keypair is unique and represents an identity of the (e.g. repository) user, I tend to use email format: user@domain

-b bits Specifies the number of bits in the key to create. For RSA keys, the minimum size is 1024 bits and the default is 3072 bits. Generally, 3072 bits is considered sufficient

To copy the contents of the file to clipboard:

xclip -sel clip < ~/.ssh/

No comments: