SSH Keygen

To create a private and public key pair run the command ssh-keygen

Syntax :

-t <dsa|rsa|ecdsa|ed25519> //Specifies the type of key to create.
-b 2048 //Number of bits
-v Verbose
-N 'passphrase'

Examle : ssh-keygen -t rsa -b 202 -N 'xxxxx' -f '/home/temp/sftp_rsa'

But you can also run the command ssh-keygen and let the prompt help you example below :

The keys are created at location ~/.ssh

id_rsa is the private key is the public key

Contents of id_rsa private key

Contents of i.e the content of the public key

Check the fingerprint/algorithm/bits of a public key (A hash of a public key)

//l for listing
//v for verbose
//-E for hasing algorithm

ssh-keygen -lv -E <md5|SHA256> -f
ssh-keygen -lv -E SH256 -f

2048 SHA256:pcnZLDwdET9rvXM9S9CGaed1pvOxGUGOW3i+kH6OzcE tyson@tyson-Lenovo-ideapad-330-15IKB (RSA)

Verify the passphrase of a private key

ssh-keygen -y -f '/home/tyson/Desktop/Test/temp/sftp_rsa'

You can copy your SSH public key to a remote machine using below command

ssh-copy-id username@remote-ip
ssh-copy-ip sfpt@

Certificates :

Read Me :

SSH-Keygen manual

Some information on certificates

Leave a Comment