And am curious to know what is it that makes it a one-time activity on Ubuntu machine and a repeated activity on Windows 10 Linux Subsystem.
Normally, the ssh-agent
runs in your session so it does not close earlier than you logout from your account in Linux.
If you use it from WLS and close the (probably) last window, it does reasonable cleanup and probably stops your ssh-agent
, which is reasonable and safe to remove sensitive data from memory.
My question is how can we make the ssh-add path/to/identity/file/custom-named action persistent like it happens on actual Ubuntu machine.
Just do not close that window (or leave one opened on background ... it might help too). Or configure ssh
to do that step automatically when you use the key for the first time. Just write to your ~/.ssh/config
Host server-you-are-connecting.to
IdentityFile path/to/identity/file/custom-named
AddIdentityToAgentAddKeysToAgent yes