Difference between revisions of "Openssh windows"
Jump to navigation
Jump to search
| Line 13: | Line 13: | ||
``` | ``` | ||
| − | Fix Permissions | + | # Fix Permissions |
| + | |||
| + | https://stackoverflow.com/questions/16212816/setting-up-openssh-for-windows-using-public-key-authentication | ||
``` | ``` | ||
| − | + | ||
| + | $acl = Get-Acl C:\ProgramData\ssh\administrators_authorized_keys | ||
| + | $acl.SetAccessRuleProtection($true, $false) | ||
| + | $administratorsRule = New-Object system.security.accesscontrol.filesystemaccessrule("Administrators","FullControl","Allow") | ||
| + | $systemRule = New-Object system.security.accesscontrol.filesystemaccessrule("SYSTEM","FullControl","Allow") | ||
| + | $acl.SetAccessRule($administratorsRule) | ||
| + | $acl.SetAccessRule($systemRule) | ||
| + | $acl | Set-Acl | ||
``` | ``` | ||
Revision as of 06:11, 12 November 2023
https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_server_configuration
https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_keymanagement
Add-WindowsCapability -Online -Name OpenSSH.Serve\~\~\~\~0.0.1.0 Add-WindowsCapability -Online -Name OpenSSH.Client\~\~\~\~0.0.1.0
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -PropertyType String -Force
Fix Permissions
<br />$acl = Get-Acl C:\ProgramData\ssh\administrators_authorized_keys
$acl.SetAccessRuleProtection($true, $false)
$administratorsRule = New-Object system.security.accesscontrol.filesystemaccessrule("Administrators","FullControl","Allow")
$systemRule = New-Object system.security.accesscontrol.filesystemaccessrule("SYSTEM","FullControl","Allow")
$acl.SetAccessRule($administratorsRule)
$acl.SetAccessRule($systemRule)
$acl | Set-Acl