Skip to content

Instantly share code, notes, and snippets.

@AStupidBear
Created August 12, 2019 07:37
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 AStupidBear/08a14af0e576a3c4b4c4be99bbd23855 to your computer and use it in GitHub Desktop.
Save AStupidBear/08a14af0e576a3c4b4c4be99bbd23855 to your computer and use it in GitHub Desktop.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest "https://github.com/PowerShell/Win32-OpenSSH/releases/download/v8.0.0.0p1-Beta/OpenSSH-Win64.zip" -OutFile OpenSSH-Win64.zip
Add-Type -AssemblyName System.IO.Compression.FileSystem
function Unzip
{
param([string]$zipfile, [string]$outpath)
[System.IO.Compression.ZipFile]::ExtractToDirectory($zipfile, $outpath)
}
Unzip OpenSSH-Win64.zip "C:\Program Files\"
cd "C:\Program Files\OpenSSH-Win64"
powershell.exe -ExecutionPolicy Bypass -File ./install-sshd.ps1
netsh advfirewall firewall add rule name=sshd dir=in action=allow protocol=TCP localport=22
net start sshd
Set-Service sshd -StartupType Automatic
Set-Service ssh-agent -StartupType Automatic
# powershell.exe -ExecutionPolicy Bypass -File ./uninstall-sshd.ps1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment