I have a local machine with an ssh keypair with the public one on github. As we all know, this allows me to interface with Github without the need to enter a username/password each time.
I also have a remote machine, which I can ssh into using the same public key. Visual Studio Code, allows me to interface with this machine via a workspace. And I noticed that when I run git commands via its terminal interface, I don't get a password prompt.
When I try to run the same git commands via an ssh session I started via my terminal, I'm prompted for a password.
How is Visual Studio Code achieving this? How can I achieve this with an ssh session started via my regular terminal? Note that I do not want to put my key pair on this remote machine.
I'm using Ubuntu 20.04
EDIT
I just want to note that this question might become more interesting when github removes the option of password authentication later next year.