Issue
VS Code is prompting for a password every time to connect to my server using Remote Explorer, even though I have an SSH key set up and it works in Git Bash. When I click try connecting I get the popup saying Setting up SSH Host mywebsite.com: (details) Initializing VS Code Server
and when I click details I see no such identity: /c/Users/Adam/.ssh/id_rsa_root_mywebsite.com: No such file or directory
.
This file does exist but I'm assuming it's failing to find it because this is a Git Bash file path and it's trying to run the command in cmd or PowerShell. But I have my default terminal set to Git Bash.
settings.json
"terminal.integrated.defaultProfile.windows": "Git Bash",
C:\Users\Adam\.ssh\config
Host mywebsite.com
HostName mywebsite.com
User root
IdentityFile /c/Users/Adam/.ssh/id_rsa_root_mywebsite.com
Solution
Even though Git Bash is the default terminal, the Remote SSH feature directly invokes ssh commands using whatever ssh command it finds in PATH. The solution was to add this line to settings.json
:
"remote.SSH.path": "C:\\Program Files\\Git\\usr\\bin\\ssh.exe",
Answered By - pyjamas Answer Checked By - Willingham (WPSolving Volunteer)