I’m working on a script which uses functions that can only be used from a certain host. I can connect to this host through SSH and work remote on the host. I’ve set up openssh on my laptop (Windows 11) and added the proper keys for ssh-agent with ssh-add. This works until VS Code Source Control is used.
The code I’m working on is on GitHub. Whenever I try to clone that repo I get
2024-06-20 09:45:30.266 [info] > git clone [email protected]:<my_name>/<my_project>.git /home/<my_name>/Documenten/scripts/<my_project> --progress [641ms]
2024-06-20 09:45:30.266 [info] Cloning into '/home/<my_name>/Documenten/scripts/<my_project>'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I can in fact clone the repo from a terminal (directly on the remote host). Same problem with other git operation like push, pull, pull requests and such. I allways have to do those on the terminal.
I don’t get this. The public keys which are used on the remote and the laptop are in my GitHub -> Settings -> SSH keys.
Since the project I’m working on is getting more and more complex I would like to use Source Control in VS Code.
I presummed VS Code Source Control was using the key I set up using openssh on my laptop, or even the ones in the remote (which allso has a running ssh-agent with the key). But I’m staring to wonder which key vsCode Source Control is using.
When taking the remote host out of the equation (i.e. clone a repo to a local folder on my laptop) everything works as expected.