I'm using Visual Studio Code on Windows 7, along with Microsoft's Remote SSH extension. I added new remote host, and saved configuration in ssh_config file.
When I open that file, everything looks ok, both User
and Host
values. However, when extension asks me for a password, I can see that it doesn't use [email protected] , values that are written in ssh_config files, instead it uses proper host but it also uses my windows username instead of the username I set in ssh_config file.
Any solutions to that?
The Visual Studio Code Remote - SSH extension allows you to open a remote folder on any remote machine, virtual machine, or container with a running SSH server and take full advantage of VS Code's feature set. Once connected to a server, you can interact with files and folders anywhere on the remote filesystem.
VS Code Remote SSHSSH, or the secure shell protocol, lets you access a remote computer or virtual machine securely over a network connection. You can connect over SSH into another machine from Visual Studio Code and interact with files and folders anywhere on that remote filesystem.
Add SSH key to your VMSelect Use existing public key in the dropdown for SSH public key source so that you can use the public key you just generated. Take the public key and paste it into your VM setup, by copying the entire contents of the id_ed25519. pub in the SSH public key.
I found that including the username in the Host definition of the .ssh config file fixed it for me.
Edit the contents of C:/Users/me/.ssh/config from:
Host bar
User foo
HostName bar
ForwardAgent yes
to:
Host foo@bar
User foo
HostName bar
ForwardAgent yes
I had the same problem, and what fixed it for me was disabling remote.SSH.useLocalServer
in VS Code's settings.
Source: https://github.com/microsoft/vscode-remote-release/issues/2512
Edit: fix link.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With