

This is used to verify the authenticity of the SSH connection.Every time you do SSH to another server, the SSH fingerprint for the secure connection is added to the client's ~/.ssh/known_hosts file.The comment in your key file has been changed.Ĭheck the new comment of your private key # ssh-keygen -lģ072 SHA256:JxBpArCDsIVME0HDtQG7FqFQefaS9ommeohVoEmg39g This is for (RSA) Key now has comment 'This is for 'Įnter new comment: This is for You can also change the existing comment of your private key using -c argument # ssh-keygen -cĮnter file in which the key is (/root/.ssh/id_rsa): In this example i will generate keys with 4096 bit sizeĪLSO READ: 5 commands to copy file from one server to another in Linux or Unix 8. You can also specify the number of bits to be used for the keys by using -b In this example I am creating key pair of ED25519 typeīy default ssh-keygen generates SSH key with 2048 bit size.Use -t argument to define the type of the key.

You can create key with dsa, ecdsa, ed25519, or rsa type.By default ssh-keygen will create RSA type key.Snippet from my terminal Generate SSH Key without any arguments Next provided the passphrase, you can just press ENTER to create passphrase less key pair.The default naming syntax used for the private RSA key will be id_rsa and public key will be id_rsa.pub.The tool will create ~/.ssh if the directory does not exists already.The default location would be inside user's home folder under.The tool will prompt for the location to store the RSA key pairs.You can execute ssh-keygen without any arguments which will generate key pairs by default using RSA algorithm.Let us explore the ssh-keygen tool to generate different types of key pairs in Linuxġ. ALSO READ: vgcfgrestore: Recover LVM without Backup
