Same as in this guide, you want to use SSH, in this case connecting inside VS Code, without using a password.
Note that this will be a one-way transaction; you can only go from Host A to Host B, unless of course you follow this procedure and swap the devices.
First, generate a pair of authentication keys on Host A without using a password, being sure to use Command Prompt in Windows. In other words, this is not to be done in Windows Subsystem for Linux (WSL):
ssh-keygen -t rsa
…next, still on Host A, use SSH to create a directory, which may already exist, on Host B. You must use the password this time:
ssh foo@b mkdir -p ~/.ssh
…now, you have to get the key you generated over to Host B. The only way I’ve done this so far is cut and paste.
Cut and paste the contents from:
~/.ssh/id_rsa.pub
…to the authorized_keys file on Host B, probably using SSH and again with a password.
At this point, you should be able to SSH from Host A as the example user ‘foo’ (or whatever username you used) to Host B under Windows and in compatible applications such as VS Code.