linux - 给sshkeypair的私钥加password phrase会影响key pair本身的配对么
黄舟
黄舟 2017-04-17 11:09:16
0
3
570

已生成的ssh key pair,私钥部分没有加password phrase做保护。现在我想给私钥加上保护的话,会影响key pari本身的配对么?

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(3)
洪涛

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...

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template