Thanks for the invitation... passphrase is not actually part of the key pair...
What people said above is that replacing the passphrase will become a new key or something...completely nonsense...
passphrase just performs an additional symmetric encryption on the private key... The common algorithm is DES or AES...
The specific algorithm used can be seen in the header of the encrypted private key...
The content of the private key file after adding passphrase is actually the ciphertext of the private key... not the private key itself...
The ciphertext does not participate in the matching... so you can change the passphrase at will without worrying about what will be affected...
In other words... you can have multiple copies of a private key using different passphrase... and all can be paired with the corresponding public key...
By the way... To view and remove passphrase, that is, the private key participating in pairing, you can use the following command...
openssl rsa -in ~/.ssh/your.key -outform pem
You can see...the same private key, no matter how the passphrase changes...the output result is the same...
Thanks for the invitation... passphrase is not actually part of the key pair...
What people said above is that replacing the passphrase will become a new key or something...completely nonsense...
passphrase just performs an additional symmetric encryption on the private key... The common algorithm is DES or AES...
The specific algorithm used can be seen in the header of the encrypted private key...
The content of the private key file after adding passphrase is actually the ciphertext of the private key... not the private key itself...
The ciphertext does not participate in the matching... so you can change the passphrase at will without worrying about what will be affected...
In other words... you can have multiple copies of a private key using different passphrase... and all can be paired with the corresponding public key...
By the way... To view and remove passphrase, that is, the private key participating in pairing, you can use the following command...
You can see...the same private key, no matter how the passphrase changes...the output result is the same...
Yeah, that’s it...
Just like if you are afraid of losing your key one day, give the key to your home a keychain or a lanyard
Add password phrase and it will become a new key