So for windows, I see the default ssh client config supposed to be placed at C:\Users\Admin\.ssh\config
and I use the same, also I am the Admin user.
I added the following ssh client side config:
PS C:\Users\Admin> type .\.ssh\config
Host gc
HostName gitlab.com
User git
IdentityFile ~/.ssh/company_gitlab
Host gp
HostName gitlab.com
User git
IdentityFile ~/.ssh/gitlab_personal
I tested it from Powershell and it is working for both my company and personal GitLab accounts using their respective ssh keys.
PS C:\Users\Admin> ssh -T git@gc
Enter passphrase for key 'C:\Users\Admin/.ssh/company_gitlab':
Welcome to GitLab, @johnwilson!
PS C:\Users\Admin> ssh -T git@gp
Enter passphrase for key 'C:\Users\Admin/.ssh/gitlab_personal':
Welcome to GitLab, @jwilson!
But when it comes to the vscode, when I try to push or pull changes to the remote repository, the following error shows up for both the company and personal GitLab accounts.
> git push -u gc master
git@gitlab.com: Permission denied (publickey,keyboard-interactive).
fatal: Could not read from remote repository.
> git push -u gp master
git@gitlab.com: Permission denied (publickey,keyboard-interactive).
fatal: Could not read from remote repository.
I tried the suggestion from here as well
PS C:\Users\Admin\ownCloud\Company\GitLab\userlist> git remote add origin git@gc:company/infra_code/userlist.git
PS C:\Users\Admin\ownCloud\Company\GitLab\userlist> git remote -v
origin git@gc:company/infra_code/userlist.git (fetch)
origin git@gc:company/infra_code/userlist.git (push)
PS C:\Users\Admin\ownCloud\Company\GitLab\userlist> git ls-remote origin
Enter passphrase for key 'C:\Users\Admin/.ssh/company_gitlab':
611b36ef47056773c288499cb6974d8671196d78 HEAD
611b36ef47056773c288499cb6974d8671196d78 refs/heads/master
I am confused, so vscode does not pick the default ssh client config C:\Users\Admin\.ssh\config
on windows ?.
Or am I missing something?.