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
According to the discussion in microsoft/WSL#3183, the issue with ssh-agent on Ubuntu 18.04 is fixed in insiders build 17704. The fix will be pushed out to regular Windows builds as part of the Fall 2018 update. In the meantime, one reported work-around is to retrieve the ssh-agent binary for Ubuntu 16.04 from the Ubuntu site and use that on 18.04 for now. In #3183 there is a recipe by @rcarmo how to do that.