My thoughts and a repository for things I find useful

Web Developer @ Gumpo Ltd
Email wil2095@protonmail.com
X / Twitter @wil2095

Generate SSH key pair from the command line

Development

Blog

Using an SSH key pair is my perfered method of authenticating with a server, such as web hosting.

From the command line:

ssh-keygen -t rsa -b 4096 -C "my config description"

  • -t rsa: Specifies the type of key to create (RSA)
  • -b 4096: Specifies the number of bits in the key 
  • -C  An optional comment to describe the key

2 files will be generated, a private key and a public key (.pub extension). The public key is used on the hosting site. The private key is never shared. 

Files can be edited with a text editor.