Subject: Bug#1156: another workaround

From: Jonathan Landis <[email-masked]>
Date: Fri, 4 May 2018 17:39:49 -0700

You can fix the file permissions without Cygwin, but not with File
Explorer. You need to use the industrial-strength subinacl.exe tool
available for free from Microsoft. It's often the only option for
permissions issues, so it is useful to have around.

As noted earlier in the thread, the ssh_host_rsa_key file's primary group
is the same as the user. So the group permissions are the user permissions,
and there is no possible way to satisfy the permissions requirements, even
if you delete all permissions entries except the one for the user.

So what you have to do is set the primary group to something else, and make
sure that it doesn't have access to the file. Like this:

"c:\Program Files (x86)\Windows Resource Kits\Tools\subinacl.exe" /file
ssh_host_rsa_key /setprimarygroup=Administrators

That will set the primary group to the builtin Administrators group. Make
sure that group doesn't have an access grant (which can be done in File
Explorer if desired).