Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
vdonchev opened this issue May 2, 2018 · 19 comments
Closed

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

vdonchev opened this issue May 2, 2018 · 19 comments

Comments

@vdonchev
Copy link

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:

λ 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

@vdonchev
Copy link
Author

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
Copy link
Member

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

@vdonchev
Copy link
Author

vdonchev commented May 4, 2018

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

@vdonchev vdonchev closed this as completed May 4, 2018
@Jiwangreal
Copy link

It does not work.....OMG

@marsggbo
Copy link

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
Copy link

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

@Jiwangreal
Copy link

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

image

@RizhaoCai
Copy link

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
Copy link

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

@beginnerJq
Copy link

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

@Guchshenskaya
Copy link

Guchshenskaya commented Jun 25, 2020

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

image

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

@mrdcn
Copy link

mrdcn commented Jul 26, 2020

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

image

It helps for me!!!!!!!!!!!!!!! Thanks

@prairiewolf-by
Copy link

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
Copy link

jethas-bennettjones commented Oct 22, 2020

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

@isquicha
Copy link

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

image

Worked for me, thaks!

@AllanOricil
Copy link

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.

@CoolCat64
Copy link

CoolCat64 commented Oct 3, 2021

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.

@Cheny5863
Copy link

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

image

best answer!!! thank u

@KaiChen1998
Copy link

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

image

Thank you! This works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests