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

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

λ ssh myserver
Bad owner or permissions on C:\\Users\\MY_USER/.ssh/config

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

problem

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 19 (1 by maintainers)

Most upvoted comments

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, eveyone!I have solved, but setting a content in my vs codes solves the issue !

image

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?

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? 你可以添加一个用户权限 Snipaste_2019-11-25_16-18-19 Snipaste_2019-11-25_16-19-00

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

You can also fix this from the command line. Here are the commands I used:

icacls c:\users\<username>\.ssh\config /inheritance:r
icacls c:\users\<username>\.ssh\config /grant <username>:f

icacls c:\users\<username>\.ssh\id_rsa /inheritance:r
icacls c:\users\<username>\.ssh\id_rsa /grant <username>:f

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

It does not work…OMG

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

If you followed this without thinking, like I did, it will solve the problem but leave you with no permissions on the file. I resolved this by opening a PowerShell with Administrator privileges, and then ran the following command on the file: takeown /F C:\Users\<user-name>\.ssh\config Where <user-name> is your user name on the system. Then, you can set yourself as the owner and reassign permissions properly through the right-click menu as you normally would. Hope this helps someone.

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