Host github.com-jiggneshhgohel
HostName github.com
User git
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_work_gmail
AddKeysToAgent yes
Host csexperimental.abc.com
IdentityFile ~/.ssh/id_work_gmail
AddKeysToAgent yes
References:
- https://stackoverflow.com/a/45562886/936494 - summarizes everything listed in this gist in form of steps which can be followed to resolve SSH agent issues.
- https://superuser.com/questions/1238486/windows-10-linux-subsystem-ssh-agent-not-persisting-added-identities#1238595 - This is the original post which details the issue I was facing
- https://unix.stackexchange.com/questions/269121/openssh-have-ssh-add-keys-to-agent-as-needed
- https://stackoverflow.com/a/41555393/936494 - This one I used to upgrade my SSH version
FROM
$ ssh -V
OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8, OpenSSL 1.0.1f 6 Jan 2014
TO
~$ ssh -V
OpenSSH_7.3p1 Ubuntu-1, OpenSSL 1.0.2g 1 Mar 2016
I was wondering which of the links you've included lead to the solution for having the keys in the config file get added to the ssh-agent on loading bash for wsl. I've tried adding the line
AddKeysToAgent yes
to no avail. On load, I find that I get prompted for the passphrase for id_rsa, but I still need to manually typessh-add gitKey
before the proper private key is added to my ssh-agent. Thanks for documenting your progress, btw.