Related: Disable Gnome Keyring SSH Agent
SSH Agent remembers SSH Public Key authentication for a period of time. While native Windows has SSH built in, there is no straightforward way to have an SSH agent in Windows itself. Instead, one can use WSL for SSH agent as follows.
SSH agent setup
This works for Linux in general, including Windows Subsystem for Linux.
if [ -z "$(pgrep ssh-agent)" ]; then rm -rf /tmp/ssh-* eval $(ssh-agent -s) > /dev/null else export SSH_AGENT_PID=$(pgrep ssh-agent) export SSH_AUTH_SOCK=$(find /tmp/ssh-* -name agent.*) fi
Open a new Terminal and type:
ssh-add -t 30m ~/.ssh/mygithubkey
- remember authentication for a period of time (here, 30 minutes)
When done SSHing, you can optionally remove all SSH agent keys from RAM by
Add multiple SSH keys in one command by commands like: