Skip to content

Instantly share code, notes, and snippets.

@trodemaster
Created September 18, 2019 00:02
Show Gist options
  • Save trodemaster/79cf2f2ef96c7c1043fb37ccaeb21457 to your computer and use it in GitHub Desktop.
Save trodemaster/79cf2f2ef96c7c1043fb37ccaeb21457 to your computer and use it in GitHub Desktop.
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install -y openssh -params '"/SSHServerFeature"' -force
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -PropertyType String -Force
New-Item -ItemType "directory" -Path "c:\Users\Administrator\.ssh" -ErrorAction 0
Set-Content -Path c:\Users\Administrator\.ssh\authorized_keys -Value 'ssh-ed25519 AAAAC3NzaC1lUSEYOUROWNKEN+WQwgLuE0g4aK'
& "C:\Program Files\OpenSSH-Win64\FixHostFilePermissions.ps1"
& "C:\Program Files\OpenSSH-Win64\FixUserFilePermissions.ps1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment