Using SSH key passphrases

It is highly recommended to set a passphrase during the generation of an SSH key. However, this then means that you have to enter that passphrase every time you use the ssh key; UNLESS you add that key to an ssh-agent. Configure an authentication agent to handle your passphrase so you can keep it secure and don't have to enter it for each use. However, this is done differently between systems. So here's what happened to me: I generated a key + passphrase on a Linux system and didn't add it to an ssh-agent. After getting annoyed by having to use the passphrase all the time, I decided to remove it via command line. The following will decrypt the private key file and write it to a new temp file that would be used to overwrite the original encrypted private key file--> ~$ openssl rsa -in <Encrypted key filename> -out <Unencrypted key filename> ~$ mv <Unencrypted key filename> <Encrypted key filename> Months later, on a Mac OS, I generated a key + passphrase, sans ssh-agent, and got annoyed with the constant passphrase entry. So when I tried my previous solution above, I received this error: "unable to load Private Key 140736254190536:error: 0906D06C:PEM routines: PEM_read_bio:no start line: /BuildRoot/Library/ Caches/ com.apple.xbs/ Sources/libressl/ libressl-22.50.3/ libressl/ crypto/pem/ pem_lib.c:704: Expecting: ANY PRIVATE KEY". Extensive web searches to fix the issue did not help. While addressing a similarly related issue, I came across the proper way to set all this up! Thanks GitHub! Link--> https://docs.github.com/ en/free-pro-team@latest/ github/authenticating-to-github/ working-with-ssh-key-passphrases Saving a passphrase to the keychain on Mac OS--> ~$ eval "$(ssh-agent -s)" > Agent pid <some numbers> ~$ open ~/.ssh/config ~$ nano ~/.ssh/config >> Host * AddKeysToAgent yes UseKeychain yes IdentityFile ~/.ssh/<private key filename> ~$ ssh-add -K ~/.ssh/<private key filename> **************************** For Linux it's much simpler--> ~$ eval "$(ssh-agent -s)" > Agent pid <some numbers> ~$ ssh-add ~/.ssh/<private key filename>