How to change private ssh key password

Post Written by
Ivan Dabić
Last modified on June 29th, 2020 at 3:56 pm

The goal of this article is to describe the process behind changing the passphrase used to generate ssh key pair (private and public) due to security policies or other scenarios where passphrase tends to be a liability in strictly security sense of the word.

When the ssh key is generated and passphrase selected, as a part of ssh key generating process, the private key is being encrypted (at the time of writing this post-default encryption algorithm is AES128) and the header is being added to the top of the file content. Generating this key would look like:

~ orangecloud$ ssh-keygen -t rsa -b 4096 -C office@orangecloud.systems
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/ivan/.ssh/id_rsa): oc
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in oc.
Your public key has been saved in oc.pub.
The key fingerprint is:
SHA256:o9wX6vBL8cwHHybbNZk1MuBcBa1i9IKd+s6fP3CLVsU office@orangecloud.systems
The key's randomart image is:
+---[RSA 4096]----+
|           . o+. |
|          o.o  . |
|          +ooo.o.|
|         . * oo+E|
|        S * = = .|
|     . o O O + + |
|      + + B + = .|
|       = ..o o.o |
|        +..ooo...|
+----[SHA256]-----+

Password used in this process was thisistestpassword. Let us look into the content of newly generated private key:

~ orangecloud$ cat oc
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-128-CBC,0C889803ACE1A2875533D8056A40AD19n2qZqtAxkFHkcyfHNSSCtoGYOf47EuDGFIY987djteu65KEjwtkstrtPZXUZrcYfKKb49GygBSkaDf5JfGpumRAnOb22DETTahz0VXrmduk0SfMiZ3/loneBQ3oXD9yMfTFgIzT6yT280MyrWA0Z4qP9q59/pO4kFVzPeAQgJ46FBSuERH/cGBoEekH5UcSIJyzJ2t3+1QWN3Ly3/8ocnXctPLZg87mxQAoEK0GqwzFt+NGQJsHOxjTJgV464Y6KM3DlRFOtoNAPN+j9J6OZqq7QZoOflVS7EPP3C38Pgl4/uh+hd+5zRbEvNS5+nDaNwAoQ6uZCVrDTNPYMwALhtmeOL/qkha/4NZ6GXxlVRpu0ELOBc6x9bp8msndEg9oc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lDGvktxWTeYMcih6Op7jrRf+q5c+fAI830sziGlGlpa0m+U2mjoupMwlGnlpH/teq7vObTQUsSpcJ6DLUHQotmckofzaCKJ2UPhhTcpaenFUm3RuxRXSnb9EO7koHGHjwn7DWQ/4ZeQyelSftQgHTPf1s/KiE3AFpWodrLOQAcnXzqherfqk3nzg23DYsQ240MQAMCuQ8Hn1NuZcVAPsp72dS69jIFaDJLLS0lJwaEKuzJmIF/GMaRDYRpvAGp933C4kCu9nK3gd4AN9ApSp8cARN1nLLE5OaBz7s0CZ1aO416fsOkL5xaB7MNQgeYD4zAn0FxDymyEAwTZhJc4sB3hTuAGLFkitKLsMf1ffhi+VUQRNtSzzHI8SqAfkkZtB47rpvRtAAATqfdbcKV9gBr9UonVdhOI2eYR8KC/aigrn2x3mQELGqKsy1RoWXYmE8geNGNmYcCoxStLfB98p3JoyxUuCRPxsCxB0emeIDAsp49VcvhC1e5JyZq7OmyHvzH9sXSlz56RNdbEcC1z3dHxutRfJrqOpUQ49Gh9ICpiX/gl8eyCCf7ezZbCHOb7vO0/CAH0AdBFEmVFONlN4vm+IC2f
-----END RSA PRIVATE KEY-----

In the header of this file you can find Proc-Type information and DEK-INFO which is needed for this key to be decrypted. It shows encryption algorithm used (in this case AES128), in which chaining mode (in this case it was CBC) and first/initializing vector for chaining mode (0C889803ACE1A2875533D8056A40AD19).

When connecting to desired server via ssh you would simply call ssh user@server -i /path/to/private_key and then put in the passphrase used while generating the key pair (in my case it was "thisistestpassword") and if remote connections are allowed AND key file permissions are properly set (note that for security reasons you would need to set the permissions on key file(s) to 400 or r-- --- ---) you would connect to it.

Pretty simple? Ok, so this is all perfect until the point where you end up not logging onto this server for some time and passphrase used has gone away and got forgotten. Then you could either generate a new key and ask system administrators to replace your key with new one, which can be a long process through approval chain or you could simply change the encryption passphrase. Step by step process would go something like:

openssl rsa -in oc -out oc_new
Enter pass phrase for oc:
writing RSA key

Password for decryption was the old one "thisistestpassword". Decrypted key would look like this:

~ orangecloud$ cat o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bVjikYLJPTS335JQarQqwTrqWUpEwu+4v8wPm5R1Oi2D8lm7ZW7u+NVF+dKK0zAR04JoYiMpb2QGuOlOp+tvnCDyQqKOYfEHEetvp0T662gjC+kluB8FHXlg8ukXsWit3tQMFXSCLpV9R88cyLORlMRDx21CrAPCQA3xF2TB/bES6r8GeCFKjXBHHAjizvDQSGoQNgwJ+1CXgqTIhFQBtXk2/Po/9A815iZu2Nl+3kCOvquIx8Vlh8rnn+c8b9aRkyS4Our3J1/r3IM4SIaktHrR6sTHM8nfTS1MNF+KoZz6U3lVkjAc2ZqCoL+InN0ulSC6HoP75OQiYlQKCAQEAud8Zkj8S9oN9I1GwgF0xAdZPC7r2iufqEOwAjYTwDnbYofYB+63eG76M/p+ck0aQoYtoPzyFIyG8NAMIxrNrx46b57ZE3lSYAQRqNf5/v1tRoXAgdAJpTyCOn9oui19iMin5PJbsrTHcI96llXQZ6q1LOZTdHW9GTmUCO7Sq7tS7Vj2+K0lf00T8bgBq21dghz2zVZ2Aslen5nTi0ihRaw/DKqumP64pOPDBkMhg9WY3jUddUn6ycQznGP9wCSmPRASpJ8d/5+NPP30MQvBVkIIvuS3uORkqhBV3rwRKKwyaencRsxkRKcqvpob/8Xu+cfBl22wfaOrbIzEvjC+FMQKCAQA1x75ZiIhqfXo9tUutD2RkvtXa1WuSdKi/fhEyJfHBGVTJZiF2wHcC7QQZgJ9QVoFItXVrVFwO9IK0uh/SQDTXqlEp
8zKqleZh85odG7v9Efbauf+DwF1+CnRoRwoxrDExyCe74h9Q3nplmxKsp+PDwnUtbqbqpmtS2PGU9PsmsnZGabtCnw/YSugNqIZ6gSnjMIqCmHRqhnH72odbJPJrFsjtUEXdvoGRX6vWPuixyGSZHtEtru92L8mRRs8hq2+eA6IpMpb5EtpohHetMNRFDWqHIKqmK3DPF2R1XhDQBbQf12me+M/qo6fqGbwne8D7YdAWEQjpEJRRlRjk5eoZ
-----END RSA PRIVATE KEY-----

Now to encrypt it with new password "thisisnewpassphrase" we would do something like:

~ orangecloud$ openssl rsa -in oc_new -out oc_newer -aes128
writing RSA key
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:

And newly encrypted private key now looks like:

~ orangecloud$ cat oc_newer
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-128-CBC,0C75618CB547A2F89F02DE8164373521

4UIITHD1wak/Vpcmc21iGJJc7/Ew3bXlijgp54Bw73qIOHQEgIGqFhiafKuf5o0RtGNPEygScv3YfsU1St+s+VZufGriJhIYWaiUPxxRz2Q9zdUYbTb6/Go5rFtVcDYgl9U4TZ0obX8ZXldJhf0llqAzKErdhhpSEJdXUQD+WuAJ2wn9rMbMvOtlyU3ql0BIE+fT7QP+dZGl/c0qVljQHG/wdo1Q5iWZTh6DunfgXXVmiOeE5qm8hC/u4TkPtYJY7Rul7E1wHmaJYj6KzKBSWBPGnItzJvXpz7ZrR8kliCTF4KrbZ1+60hIlSVFGrCnp1ElOXDq7nXJN8VNhc80FokfR8LEnb2Dkj9i7pHnkEx+MwoUCicSb38NGLvA7cjKFFenb5XeUtfe5e2pNEql+9xEkih29sBWutcSlSoDpRqf2zzbILiXSd5dVjUPxzO/NXqbwXYvkC6iJD1oDas05rjS5wawQGP1i7nD5mL9uond8z4gMSpfctRxEQZAIW7FHN1uG2V43Ey1niY4gxuV79vCFBm1o3+LH3yZCY27t3hhfzpzYhy84+vIyWFmC+OPM1BxOMUm5usqtSiS/tg/quJMqGzknjG7hKDsOlvymepV81hiarI5bh61uGjJ9EEDyLhe16sFSJ1b6HUs3Fluzk8AqsLYMWn8nIcgejl1PtK7htoAWanrbYODfpF/zpwrXOws2sBiDG8PttQYWXagX5GC7nKnb2UcNFLArH44c3dAyZwcVeVgEHrLJhDY/aTDTJeGt+YlmtZlY4VbvmuV8FNjRv0mQrqKEDxVHWjT48Vi5eszhGHsQjg+yCmsHcpuiZpKvcXiX7vA663iqrGBS42QhNriSbQguTImjPO/cZzSvrc4daYW5IgzcIjil+ipJ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nG7uXMLEOBHExztWx6dER6bW1gWmtU1Bsir4FMa4G4j4X2ANfhOtlFrJdNf7AKGaSROdBBUXlsF6yJg0LtrKS74PG89J99YSAQXy25
-----END RSA PRIVATE KEY-----

Needless to say "thisisnewpassphrase" would be new passphrase ot be used when connecting to same server from this point on. I have taken the longer way to change the password so I can explain some of the steps but, (don't kill me now lol) we could have done this much faster:

~ orangecloud$ openssl rsa -in oc -out oc_newer2 -aes128
Enter pass phrase for oc:
writing RSA key
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:

In the above steps, we've been asked to provide original passphrase (thisistestpassword) and then the new one (thisisnewpassphrase) which resulted in creation of new key pair where the private key is encrypted with the new passphrase.

Contact Us

Fill out the enquiry form and we'll get back to you as soon as possible.

*Max. file size 5MB


*How did you find out about us?