Skip to content

Instantly share code, notes, and snippets.

@nachoal
Last active February 14, 2026 20:45
Show Gist options
  • Select an option

  • Save nachoal/a45f7e07d07fc9688dae7df1b84e45f8 to your computer and use it in GitHub Desktop.

Select an option

Save nachoal/a45f7e07d07fc9688dae7df1b84e45f8 to your computer and use it in GitHub Desktop.
Stop-Service sshd; Start-Sleep 2; (Get-Content C:\ProgramData\ssh\sshd_config) -replace 'Match Group administrators','#Match Group administrators' -replace 'AuthorizedKeysFile __PROGRAMDATA__','#AuthorizedKeysFile __PROGRAMDATA__' | Set-Content C:\ProgramData\ssh\sshd_config; Start-Service sshd; echo "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment