Ssh bad permissions windows

Содержание
  1. Bad owner or permissions on C:\Users\USER/.ssh/config #1763
  2. Comments
  3. vdonchev commented May 2, 2018
  4. vdonchev commented May 4, 2018 •
  5. Stanzilla commented May 4, 2018
  6. vdonchev commented May 4, 2018
  7. Jiwangreal commented Nov 8, 2019
  8. marsggbo commented Nov 24, 2019
  9. qy527145 commented Nov 25, 2019
  10. Jiwangreal commented Nov 26, 2019
  11. RizhaoCai commented Dec 23, 2019
  12. djhmateer commented Mar 5, 2020
  13. beginnerJq commented Mar 17, 2020
  14. Guchshenskaya commented Jun 25, 2020 •
  15. mrdcn commented Jul 26, 2020
  16. prairiewolf-by commented Aug 20, 2020
  17. jethas-bennettjones commented Oct 22, 2020
  18. isquicha commented Oct 24, 2020
  19. AllanOricil commented Nov 7, 2020
  20. Bad Owner or Permissions on %USERPROFILE%\.ssh\config file on Windows 10 #119
  21. Comments
  22. bunnyvishal6 commented May 4, 2019
  23. bunnyvishal6 commented May 4, 2019
  24. murilogiatti commented May 4, 2019
  25. bunnyvishal6 commented May 4, 2019
  26. murilogiatti commented May 4, 2019
  27. bunnyvishal6 commented May 4, 2019 •
  28. Chuxel commented May 4, 2019
  29. bunnyvishal6 commented May 4, 2019
  30. Chuxel commented May 5, 2019 •
  31. bunnyvishal6 commented May 5, 2019 •
  32. Chuxel commented May 5, 2019 •
  33. bunnyvishal6 commented May 6, 2019 •
  34. Chuxel commented May 6, 2019
  35. bunnyvishal6 commented May 6, 2019 •
  36. Chuxel commented May 7, 2019
  37. Bad Owner or Permissions on username\.ssh\config file #3210
  38. Comments
  39. mashirozx commented Nov 5, 2019
  40. mashirozx commented Nov 5, 2019 •
  41. Chuxel commented Nov 6, 2019
  42. mashirozx commented Nov 6, 2019 •
  43. Chuxel commented Nov 6, 2019
  44. mashirozx commented Nov 6, 2019
  45. mashirozx commented Nov 6, 2019
  46. Chuxel commented Nov 6, 2019
  47. hacksut3l commented Dec 6, 2019
  48. mmmeff commented Dec 29, 2019 •
  49. mashirozx commented Dec 29, 2019
  50. prashanthc97 commented Apr 3, 2020
  51. Atem18 commented May 3, 2020
  52. karpulix commented May 12, 2020
  53. phuonghx commented May 19, 2020
  54. iswangaiguo commented Jun 30, 2020
  55. vinvinodk commented Jul 22, 2020
  56. conix67 commented Aug 23, 2020
  57. Stevemaster92 commented Aug 26, 2020
  58. zxbuaa commented Sep 14, 2020
  59. doxxx commented Sep 30, 2020
  60. m3hdad commented Sep 30, 2020
  61. MrMarshall commented Oct 22, 2020
  62. solinad21 commented Nov 7, 2020
  63. timeneverdie commented Dec 5, 2020 •

Bad owner or permissions on C:\\Users\\USER/.ssh/config #1763

Comments

vdonchev commented May 2, 2018

Since yesterday’s windows update (1810), I got this error when trying to connect to any of my servers through ssh:

I am using cmder 1.3.4 (i have also tried with 1.3.5).

The text was updated successfully, but these errors were encountered:

vdonchev commented May 4, 2018 •

Ok, here’s the solution that worked for me:

Right click on file:
Properties -> Security -> Advanced -> Disable Inheritance -> Remove all inherited permissions from this object

Stanzilla commented May 4, 2018

I fail to see how that is Cmder’s fault?

vdonchev commented May 4, 2018

It’s working ok with gitbash for example. I have this problem with cmder only.

Jiwangreal commented Nov 8, 2019

It does not work. OMG

marsggbo commented Nov 24, 2019

Ok, here’s the solution that worked for me:

Right click on file:
Properties -> Security -> Advanced -> Disable Inheritance -> Remove all inherited permissions from this object

Thanks for your solution. It indeed solved my problem but raise another problem that I can’t write config file now. How can I solve this problem?

qy527145 commented Nov 25, 2019

Ok, here’s the solution that worked for me:
Right click on file:
Properties -> Security -> Advanced -> Disable Inheritance -> Remove all inherited permissions from this object

Thanks for your solution. It indeed solved my problem but raise another problem that I can’t write config file now. How can I solve this problem?
你可以添加一个用户权限

Jiwangreal commented Nov 26, 2019

Thanks, eveyone!I have solved, but setting a content in my vs codes solves the issue !

RizhaoCai commented Dec 23, 2019

Ok, here’s the solution that worked for me:

Right click on file:
Properties -> Security -> Advanced -> Disable Inheritance -> Remove all inherited permissions from this object

Thanks. It works for me.

djhmateer commented Mar 5, 2020

Remember to leave permissions for yourself (Full control was fine)

beginnerJq commented Mar 17, 2020

Ok, here’s the solution that worked for me:

Right click on file:
Properties -> Security -> Advanced -> Disable Inheritance -> Remove all inherited permissions from this object

this works for me,thanks

Читайте также:  Куда клеить наклейку windows

Guchshenskaya commented Jun 25, 2020 •

Thanks, eveyone!I have solved, but setting a content in my vs codes solves the issue !

It helps for me. Thanks. (Прописан путь C:\Users\admin\ssh\config как на скрине. И все заработало!)

mrdcn commented Jul 26, 2020

Thanks, eveyone!I have solved, but setting a content in my vs codes solves the issue !

It helps for me. Thanks

prairiewolf-by commented Aug 20, 2020

Ok, here’s the solution that worked for me:

Right click on file:
Properties -> Security -> Advanced -> Disable Inheritance -> Remove all inherited permissions from this object

For me helped ONLY setting permissions Like owner — full control (and disabling permissions inheritance, for sure!!) for two more files — ‘config’ file itself and both of my PRIVATE and PUBLIC keys. Only after that Remote-SSH plugin started working as it has to.

It seems that such permissions for VS Code are good enough like 0600 for «.ssh» folder in Linux OS’es.

jethas-bennettjones commented Oct 22, 2020

You can also fix this from the command line. Here are the commands I used:
`
icacls c:\users .ssh\config /inheritance:r
icacls c:\users .ssh\config /grant :f

icacls c:\users .ssh\id_rsa /inheritance:r
icacls c:\users .ssh\id_rsa /grant :f
`

isquicha commented Oct 24, 2020

Thanks, eveyone!I have solved, but setting a content in my vs codes solves the issue !

Worked for me, thaks!

AllanOricil commented Nov 7, 2020

Ok, here’s the solution that worked for me:

Right click on file:
Properties -> Security -> Advanced -> Disable Inheritance -> Remove all inherited permissions from this object

I had to do this change after I changed the disk where Vagrant is installed.

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Bad Owner or Permissions on %USERPROFILE%\.ssh\config file on Windows 10 #119

Comments

bunnyvishal6 commented May 4, 2019

  • VSCode Version: 1.34.0 insiders(user setup)
  • Local OS Version: Windows 10 1809
  • Remote OS Version: Ubuntu 18.04 lts
  • Remote Extension/Connection Type: SSH

Steps to Reproduce:
When I try to connect this is the error
Can’t connect to VM-IP: unreachable or not Linux x86_64 (Bad owner or permissions on C:\Users\Bunny/.ssh/config). But vm is ubuntu 18.04 and x86_64.

Here are my file permissions

Does this issue occur when you try this locally?: Yes
Does this issue occur when you try this locally and all extensions are disabled?: No

The text was updated successfully, but these errors were encountered:

bunnyvishal6 commented May 4, 2019

According to this doc, the ./ssh/config file only user should have access to it.
,

Which is a contradiction to this doc

So by removing all other permission entries from above list I can successfully run ssh from powershell or cmd but, cannot connect from vscode.

murilogiatti commented May 4, 2019

It is working for me like this.
Just my user.

bunnyvishal6 commented May 4, 2019

@murilogiatti .This is still not working for me

murilogiatti commented May 4, 2019

it is in the key file permissions, both private and public.

bunnyvishal6 commented May 4, 2019 •

@murilogiatti, My key file permissions are also same but not working. Can I contact you in private?

Chuxel commented May 4, 2019

@bunnyvishal6 Yeah, the permissions in the document are exactly how things are set up on my machine. I suspect something else may be going on here.

bunnyvishal6 commented May 4, 2019

@Chuxel Vscode remote dev doc says we need to give full control to user, Administrator and system. But doing so I cannot connect ssh from cmd or powershell, it gives Bad owner or permissions error. And also cannot connect via vscode same error. But by removing all Principals from /.ssh/config file permissions list, I can connect via cmd or pwershell with a normal ssh command. As Win32-openssh config file should not have anyother people to access otherthan owner.

Chuxel commented May 5, 2019 •

@bunnyvishal6 Windows unfortunately has lots of variations of the SSH clients that may be in your path.

If you’re using the official Windows 10 OpenSSH install, there is a utility you can use to set permissions. https://github.com/PowerShell/openssh-portable/blob/latestw_all/contrib/win32/openssh/FixUserFilePermissions.ps1

Here’s a snippet you can cut-and-paste in an administrator’s powershell window to run it.

If you still get an error, it’s possible you’re using a older or different version of the tools than Win 10 ships with or there’s more than one on your system and one is getting picked up in some scenario.

bunnyvishal6 commented May 5, 2019 •

@Chuxel, Did you get your setup working with this? I recently re installed win10. And the openSsh is the default one that comes with installation. And after installing above module, it says opensshutils.psm1 scripts are disabled. Is there a way to update openSsh client?

Is this the latest openssh client in windows10

I think my openssh client is version 0.0.1.0 and utils version is 0.0.2.0. I will uninstall current version and will install from github repo of win32-openssh

Chuxel commented May 5, 2019 •

@bunnyvishal6 Don’t install from the GitHub repo since that could be causing your problems — those are going to be development builds. Use the version that ships with Windows 10. It is known to work.

You do not need to download the script. Just cut and paste the following from an administrator power shell window.

If you get an error, please post it — no way to know what is going wrong otherwise.

bunnyvishal6 commented May 6, 2019 •

@Chuxel, I’m getting this error when i try to run above commands in elevated powershell

Chuxel commented May 6, 2019

. or if you want this to only apply to the current window.

bunnyvishal6 commented May 6, 2019 •

@Chuxel Thanks a lot. It worked. Not relevant, But I expected a demo of this today at MS Build 2019 But they just mentioned it. Anyway this is an awesome feature and I’m loving it.

Chuxel commented May 7, 2019

@bunnyvishal6 Great! Updated the docs to recommend this script. Re: //build — Yeah we announced at PyCon last week but it’s going to show up in a number of spots over the week!

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

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

Comments

mashirozx commented Nov 5, 2019

When using vscode-remote it shows C:\\Users\\username/.ssh/config .

But the command seems not work for me:

The text was updated successfully, but these errors were encountered:

mashirozx commented Nov 5, 2019 •

Chuxel commented Nov 6, 2019

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

mashirozx commented Nov 6, 2019 •

@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).

Chuxel commented Nov 6, 2019

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

mashirozx commented Nov 6, 2019

mashirozx commented Nov 6, 2019

@Chuxel Actually there is also an issue relate to the Windows version (I guess) PowerShell/Win32-OpenSSH#1445

Chuxel commented Nov 6, 2019

Yeah that looks like the issue! Let’s close this as a upstream duplicate of that problem. Since its not related to VS Code.

hacksut3l commented Dec 6, 2019

@Chuxel I also encountered this problem. Is it because of the path?

Instead of «C:\Users\username\.ssh\config»

mmmeff commented Dec 29, 2019 •

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

mashirozx commented Dec 29, 2019

@mmmeff That is the problem! 👍

prashanthc97 commented Apr 3, 2020

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

Atem18 commented May 3, 2020

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.

karpulix commented May 12, 2020


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.

phuonghx commented May 19, 2020


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.

iswangaiguo commented Jun 30, 2020


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

vinvinodk commented Jul 22, 2020

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

conix67 commented Aug 23, 2020

Stevemaster92 commented Aug 26, 2020


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

zxbuaa commented Sep 14, 2020

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?

doxxx commented Sep 30, 2020

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

m3hdad commented Sep 30, 2020

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

On my system the issue was resolved by:

  1. setting the IdentityFile path as reported above.
  2. defining custom config path for applications like vs code
Читайте также:  Linux built on unix

MrMarshall commented Oct 22, 2020

For me this was caused by the default ssh client. I got the same error when I used ssh through cmd.exe.

What solved it was using a different ssh client, e.g. the git bash ssh client. Add the following entry to your settings.json file:
«remote.SSH.path»: «C:/Program Files/Git/usr/bin/ssh.exe»

solinad21 commented Nov 7, 2020

@MrMarshall Thanks, now run OK!

timeneverdie commented Dec 5, 2020 •

I just fix this problem. Let me tell you the real reason: Don’t use Putty Key Generator!

After OpenSSH was built in Windows 10, VSCode will always use the standard key format.

Open your terminal, use the command ssh-keygen -t rsa -b 2048 -C «username» (must be a Capitalized character C)

Then use your file manager or cd in Terminal to find out the default SSH folder on Windows 10 C:\Users\Username\.ssh . You will find the private key generated just now has no extension . But if you use Putty Key Generator, your private key will have a *.ppk extension. That’s the real cause for Key Denied!

VSCode will use the default folder C:\Users\Username\.ssh for you, so you don’t need to write any SSH Key Path into the config file. But if you use another SSH library, maybe you need to edit something. (When you follow the GUI of VSCode, you will see the default SSH folder path.)

The last thing to do is upload the *.pub file to the server (or open with VSCode to copy and paste text contents into VPS Console). When done, you can login to the server directly. The information included in the config file will be used automatically.

Читайте также:  Предустановленная ос windows 10 home это

Make sure your config file has these fields:

If you want to save the private key in a special folder to let many programs use at the same time and manage them easily, just add a new keyword IdentityFile to the config file. Only with path after it (be careful with \ ).

Sometimes c:\Users\your_username\.ssh\known_hosts stores non-corret information. You can just delete all (or single) information about servers in known_hosts and then you will find the connection works. New information will be wrote into the known_hosts again after you login the new server successfully.

Оцените статью