First a short introduction what I was trying to do and how my issue showed up.
When i configure a ssh hosts in .ssh/config
I have the issue that the permissions seem to be wrong on the config-file such that I get the error message Bad owner or permissions on C:\\Users\\My Name/.ssh/config
when i try to use ssh
with a config-file present.
I already tried everything mentioned in this post: Windows SSH: Permissions for 'private-key' are too open
Nothing worked. When I tried the tip of using the following commands
icacls config /inheritance:r
icacls config /grant:r "%username%":"(R)"
to remove all permissions beside mine, I lost access to the file myself and instead of my username some S-1-5-21-...
shows up in the file permissions. My guess is that this is the root cause of the ssh issues I was seeing previously.
So %Username% (which expands to my real username) seems to be mapped to some spurious SID . Does anybody have any clue why this is so and how I can fix it?
One thing I did previously was logging into a windows account once without knowing that is would break my local user. So I immediately undid this and reverted to a local user. The only thing left from this experiment is that the user folder is still has my full name an not the name of the local user.