[LINUX] Remove ssh private key passphrase

Overview

You may ssh using your private key when connecting to the server. I wish I could generate this private key on the server myself. In recent cloud environments, the ssh key is generated on the management screen, and you may have to set the ssh key password. Of course, lowering the security level such as erasing passphrases on your own in a commercial environment is something that engineers should not do. .. ..

However, I deleted the passphrase deletion because I think it's okay to raise the security level to that level if it's a server that individuals use for private use.

Remove private key passphrase

ssh-keygen -f private key-p

ssh-keygen is the English meaning of the command itself, A command to generate an ssh key. As an option, specify the file to be read with -f. -p is used to change the passphrase. It is displayed interactively. The following is the command execution result.

Enter old passphrase:
Enter new passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved with the new passphrase.

First put in the original old passphrase. Then you will be asked to enter a new passphrase, If you press enter without entering anything here, a private key without a passphrase will be generated.

At the end

This time it was a little tip-like story. You can change the passphrase with the openssl command, I think this is easier if you can connect with ssh due to version etc.

Recommended Posts

Remove ssh private key passphrase
How to generate a public key from an SSH private key
Ubuntu (18.04.3) SSH edition Key authentication
Ssh connection using public key
Use ssh with private key public key authentication. Connect from wan.
Multi-stage SSH "holding private key locally" pattern and "holding on stepping stone" pattern