Created
August 12, 2019 07:37
-
-
Save AStupidBear/08a14af0e576a3c4b4c4be99bbd23855 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
[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