-
Notifications
You must be signed in to change notification settings - Fork 781
Questions / Problems with function Set-SecureFileACL #719
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
Comments
I have a work around - but I'm not sure if its implications. I am also creating this code to work in the chocolatey package - so a little concerned that there are other similar scenarios lurking - so I'm still very interested in why this happens and if there is another class of "special user accounts" that might cause similar errors with this particular approach to removing acls. I replaced the code:
With:
I tried some methods other than ".RemoveAccessRule" (e.g. RemoveAccessRuleSpecific) and they get the same error on the same user ids. |
Could someone on the dev team test the permissions scripts on Windows 7 / Server 2008? At first I started getting "The security identifier is not allowed to be the owner of this object" for granting ownership of the server keys to "NT SERVICE\sshd" (only on Windows 7) and researching a work around led to the following rabbit holes: https://learn-powershell.net/2014/06/24/changing-ownership-of-file-or-folder-using-powershell/ I tried an implementation of the code in that last post and couldn't get it to work. The error changes to "Attempted to perform an unauthorized operation." I also tried reordering to put the ownership change AFTER the granting of full permissions to "NT SERVICE\sshd" and AFTER the revoking of inherited permissions - no luck. |
@bingbing8 is following up |
@DarwinJS we've pulled down 0.0.13.0. We coordinate with you on the work needed before we push it out again. |
@DarwinJS, Thanks for your feedback. yes, the line should be |
@bingbing8 - thanks for your reply. The strange user account is happening only on Nano. Given that the "Domain" is "APPLICATION PACKAGE AUTHORITY" for both accounts, I was guessing that it is some type of virtual account - maybe having to do with PackageManagement in general or Nano Server Packages as a primary method of updating the OS? I will try the method call you suggest when I get some more time to focus on this. |
On this page: https://github.com/PowerShell/Win32-OpenSSH/wiki/Security-protection-of-various-files-in-win32-openssh
This code is published:
I have some questions about it:
$myACL.SetAccessRuleProtection($True, $True)
be$myACL.SetAccessRuleProtection($True, $False)'
in order to disable inherited permissions? (https://msdn.microsoft.com/en-us/library/system.security.accesscontrol.objectsecurity.setaccessruleprotection(v=vs.110).aspx)if(-not ($myACL.RemoveAccessRule($_)))
generates an exception and never falls through to the if block. I believe it needs "Try / Catch" to actually allow the offending ID to be emited.$myACL.SetAccessRuleProtection($True, $False)'
HOWEVER, these two users do not appear in the ACLs I see in Explorer - and it keeps getting the error every time. I don't know if these identities originally had permissions did or not. It's almost like there is some type of virtual ACL?
The text was updated successfully, but these errors were encountered: