vscode-docs icon indicating copy to clipboard operation
vscode-docs copied to clipboard

Bad Owner or Permissions on username\.ssh\config file

Open mashirozx opened this issue 7 years ago • 37 comments

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:

image

mashirozx avatar Nov 05 '19 05:11 mashirozx

@Chuxel Seems https://github.com/Microsoft/vscode-remote-release/issues/119 still not fix 😭

mashirozx avatar Nov 05 '19 07:11 mashirozx

@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 avatar Nov 06 '19 02:11 Chuxel

@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 avatar Nov 06 '19 22:11 mashirozx

@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 avatar Nov 06 '19 22:11 Chuxel

@Chuxel Maybe this should be a new issue in https://github.com/PowerShell/Win32-OpenSSH/? 😂

mashirozx avatar Nov 06 '19 22:11 mashirozx

@Chuxel Actually there is also an issue relate to the Windows version (I guess) https://github.com/PowerShell/Win32-OpenSSH/issues/1445

mashirozx avatar Nov 06 '19 22:11 mashirozx

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 avatar Nov 06 '19 22:11 Chuxel

@Chuxel I also encountered this problem. Is it because of the path? image Instead of "C:\Users\username\.ssh\config"

hacksut3l avatar Dec 06 '19 11:12 hacksut3l

@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 avatar Dec 29 '19 00:12 mmmeff

@mmmeff That is the problem!:+1:

mashirozx avatar Dec 29 '19 02:12 mashirozx

@mmmeff Spent 2 hours finding the issue, then came across this. Worked like a charm!

prashanthc97 avatar Apr 03 '20 08:04 prashanthc97

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.

Atem18 avatar May 03 '20 19:05 Atem18

Screenshot_34 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.

karpulix avatar May 12 '20 05:05 karpulix

Screenshot_34 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!

phuonghx avatar May 19 '20 07:05 phuonghx

Screenshot_34 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

iswangaiguo avatar Jun 30 '20 09:06 iswangaiguo

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

ghost avatar Jul 22 '20 07:07 ghost

This fixed the same issue for me - https://github.com/Microsoft/vscode-remote-release/issues/119

conix67 avatar Aug 23 '20 19:08 conix67

Screenshot_34 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

Stevemaster92 avatar Aug 26 '20 16:08 Stevemaster92

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?

zxbuaa avatar Sep 14 '20 09:09 zxbuaa

I believe this issue should be re-opened since the default configuration is broken. This should just work out of the box.

doxxx avatar Sep 30 '20 13:09 doxxx