Bad Owner or Permissions on username\.ssh\config file
When using vscode-remote it shows C:\\Users\\username/.ssh/config.
Tried to fix following the doc at https://github.com/microsoft/vscode-docs/blob/master/docs/remote/troubleshooting.md#fixing-ssh-file-permission-errors
But the command seems not work for me:

@Chuxel Seems https://github.com/Microsoft/vscode-remote-release/issues/119 still not fix 😭
@mashirozx The issue you reference was in fact resolved with this script, so if the script isn't running, that's something else.
Are you using the Windows OpenSSH client in Windows 10 1803+? If not, you can try to manually set the permissions on config and other files in the .ssh folder to SYSTEM, Administrators, and your user instead.
@Chuxel System: Windows 10 Home 1903 OS build: 18362.418
Actually I solved this problem in vscode-remote by modifying remote.SSH.configFile and remote.SSH.path and copying C:\Windows\System32\OpenSSH\ to my own directory. I think this could be showed in the docs (maybe not recommend but it works and is really easy) since the PowerShell scripts seems not really work (on all devices).
@mashirozx I'd rather not include something without an understanding of what the problem was to begin with - the configFile is covered elsewhere.
This seems to be a signature error which shouldn't be possible. The only thing I can think of is you are on Home instead of Pro or Enterprise. This is the first time this error has been reported, so something strange is going on.
@Chuxel Maybe this should be a new issue in https://github.com/PowerShell/Win32-OpenSSH/? 😂
@Chuxel Actually there is also an issue relate to the Windows version (I guess) https://github.com/PowerShell/Win32-OpenSSH/issues/1445
Yeah that looks like the issue! Let's close this as a upstream duplicate of that problem. Since its not related to VS Code.
@Chuxel I also encountered this problem. Is it because of the path?
Instead of "C:\Users\username\.ssh\config"
@hacksut3l I fixed this by setting the path in my ssh config file to C:/Users/[name]/.ssh/config or wherever your config file lives. The important part here is to use forward slashes, not the windows standard backslashes. I think this is because the Windows 10 OpenSSH client is resolving paths with PowerShell under the hood which supports both path delimiters.
For example:
Host ExampleHost
HostName 1.2.3.4
IdentityFile C:/Users/johndoe/.ssh/id_rsa
User johndoe
@mmmeff That is the problem!:+1:
@mmmeff Spent 2 hours finding the issue, then came across this. Worked like a charm!
Can confirm guys, the solution of @mmmeff is working. Should not we open another issue to fix it since by default the extension does not work.
I resolved this problem when added obvious path for .ssh config as "C:\User\Alexander\.ssh\config" (use double slash). It is working for me.
I resolved this problem when added obvious path for .ssh config as "C:\User\Alexander.ssh\config" (use double slash). It is working for me.
Thanks!
I resolved this problem when added obvious path for .ssh config as "C:\User\Alexander.ssh\config" (use double slash). It is working for me.
thank you very much,you solved my problems
Those who are using recent Windows 10 (18.03+ Update and above) will be having OpenSSH installed. You need to uninstall that feature by going to "manage optional features" in Apps and Features menu from Settings. Once uninstalled, install/keep the Git for Windows. It will solve the problem.
Windows 10 1803+ - UnInstall the Windows OpenSSH Client and Install Git for Windows Earlier Windows - Install Git for Windows
No file permissions issue hereafter. enjoy.
P.S. I ran into this issue while doing the Windows Update to 1803 and solved by uninstalling openSSH
This fixed the same issue for me - https://github.com/Microsoft/vscode-remote-release/issues/119
I resolved this problem when added obvious path for .ssh config as "C:\User\Alexander.ssh\config" (use double slash). It is working for me.
Thanks my friend! 👍 This even works without uninstalling the OpenSSH Client on Windows
I suddenly encountered this issue after login Windows with another account and then login back. Before that I didn't touch the default path of .ssh/config
Is this BUG of vscode or specific version of Windows 10?
I believe this issue should be re-opened since the default configuration is broken. This should just work out of the box.