Last active
September 1, 2020 21:57
-
-
Save micahyoung/b0c18ebde42263ee8ec9a15dada4327e to your computer and use it in GitHub Desktop.
Fix Windows OpenSSH administrator authorized key file key permissions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sshPubKey="ssh-rsa AAAA..." | |
echo $sshPubKey | out-file -Encoding ascii -Append C:\ProgramData\ssh\administrators_authorized_keys | |
$acl = Get-Acl C:\ProgramData\ssh\administrators_authorized_keys | |
$acl.SetSecurityDescriptorSddlForm("O:BAG:BAD:PAI(A;;FA;;;SY)(A;;FA;;;BA)") | |
$acl | Set-Acl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment