Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kaidokert
Last active May 2, 2023 02:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaidokert/56445a43f4cd6fc2ab752208390ae59c to your computer and use it in GitHub Desktop.
Save kaidokert/56445a43f4cd6fc2ab752208390ae59c to your computer and use it in GitHub Desktop.
Stub for testing provisioning
Add-WindowsCapability -Online -Name "OpenSSH.Server~~~~0.0.1.0"
# Dump in the key
echo ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCyFmcGw1DQhD7mns6lBQquepRf1p69ZjU/ml8bp3AA0RhDDwBYd4sjXfa/YgXS8A+5jDnivVvcqaB9jDWwGedLVYtPyObjp+OWZelGzx/hLI/E5LJ5iOh3Wu/AVJfaz+xdMEVNMq3fVNDgG72l9LlAxP8LC7tNWEGFsHESSg19RP61I8tOW5us/gjsAhwn+cZF8oURFx5daeLN7vjjXAMl6TOSvYxZR3Fcl+J/3FRTIQ0Iy5a463Jdc/lh/SMMWzwWNfTxOewm9Ay/KsA44ymcPTZOjSGfMRPeJ9KfQtbl2F/KYHkvtE5BFtwAZOVuFfrPSRWCQpPNvZp2U74/ffx2LZa8MvTIqOv1mzTeeR+/Ym6kc2CSmqkJ/STmXyj7b66gCuYfS9cwK+3Six6+8uYir1RGkjqM0WevH1V+EU0SSdyWqixK/R5GLPpwTpW3VBauEIdMZTXae4w67+EcocwiAtltZzrpizqGOE60WAHHrKPzRtGkqRo27Qor7u968kH4ir9i6Qy+4KeEiKgaZv+S0TNXIz+9tc8fpSDXw4WK0zm5Pmiu8rdRbwVLBSTFhPkvbkT4kVX2IGZtajUgP5Gw6abMGeuugeK2qYX+WsJMhXLBE6OinORTZIWsUGb5MZhPnQFCt66tcDkvuoTGYsNlujLufn99qvA8Ggo8U22/Uw== | Add-Content -Force -Path C:\ProgramData\ssh\administrators_authorized_keys
icacls 'C:\ProgramData\ssh\administrators_authorized_keys' /inheritance:r /grant 'Administrators:F' /grant 'SYSTEM:F'
Set-Service -Name sshd -StartupType 'Automatic'
Start-Service sshd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment