SSH supports using an agent to handle holding your private key in an un-encrypted state so you don’t have to continually retype your passphrase. If you did not set a passphrase on your private key, please do so now. You can set it with ssh-keygen -p -f ~/.ssh/id_rsa if using the command line, or reloading the .ppk file in PuttyGen if using Putty.
Putty
Putty comes with Pageant (Putty Agent) that you can add your keys to. Just double-click on your .ppk file to start the agent. It will stay loaded in the system tray (near the clock), if you need to add other keys to it. If you need to connect from the remote system to other systems, you’ll also want to turn on “Allow Agent Forwarding” under Connection/SSH/Auth on the configuration page.
Command line
With command line ssh, you can use the following commands to enable the ssh-agent and then add your key to it:
eval $(ssh-agent -s)
ssh-add ~/.ssh/id_rsa
If you need those keys available on the remote host, then use -o ForwardAgent=yes (or put it in ~/.ssh/config as below):
ssh -o ForwardAgent=yes remotehost
macOS
On Mac, you may want to configure ssh to use KeyChain by adding the following to ~/.ssh/config
Host *
# UseKeychain is macOS only
UseKeychain yes
# AddKeysToAgent works on all platforms
AddKeysToAgent yes
# This allows using local keys when connecting from one remote system to another
ForwardAgent yes
IdentityFile ~/.ssh/id_rsa