Last active
July 21, 2024 15:18
-
-
Save Inndy/7d036eb4413a36d9727bd724a17b26f1 to your computer and use it in GitHub Desktop.
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
Add-WindowsCapability -Online -Name (Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH.Server~~~*').Name | |
Start-Service sshd | |
Set-Service sshd -StartupType Automatic | |
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -PropertyType String -Force | |
ssh w11 powershell 'chcp 65001; Add-Content -Force -Path $env:ProgramData\ssh\administrators_authorized_keys -Value "ssh-ed25519 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";icacls.exe "$env:ProgramData\ssh\administrators_authorized_keys" /inheritance:r /grant "Administrators:F" /grant "SYSTEM:F"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment