Forrest logo
back to the ssh-keygen tool

ssh:tldr:1ed17

ssh: Change the type of the key format (for example from OPENSSH format to PEM), the file will be rewritten in-place.
$ ssh-keygen -p -N "" -m ${PEM} -f ${~--ssh-OpenSSH_private_key}
try on your machine

This command is used to change the passphrase of an SSH private key. Let's break down the elements of the command:

  • ssh-keygen: It is the command-line utility for generating and managing SSH keys.
  • -p: This flag is used to specify that the command is meant for changing the passphrase of the key.
  • -N "": This flag sets an empty passphrase, effectively removing the requirement for a passphrase. By default, the ssh-keygen command prompts for a new passphrase, but the "" value ensures an empty passphrase is set.
  • -m ${PEM}: This flag specifies the key format to use. The ${PEM} variable contains the value of the desired format, which could be PEM or PKCS8.
  • -f ${~--ssh-OpenSSH_private_key}: This flag is used to specify the path and name of the private key file. The ${~--ssh-OpenSSH_private_key} is a variable that should contain the path to the private key file.

In summary, this command changes the passphrase of the SSH private key file specified by the ${~--ssh-OpenSSH_private_key} variable to an empty passphrase, using the specified key format ${PEM}.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the ssh-keygen tool