Skip to content

Instantly share code, notes, and snippets.

View bxtp4p's full-sized avatar

Bart X Tubalinal bxtp4p

  • GitHub Staff
  • Chicago, IL
  • X @bxtp4p
View GitHub Profile
@bxtp4p
bxtp4p / Install-OpenSSH.ps1
Created December 13, 2017 22:42
Installs OpenSSH on Windows. Also configures Powershell to be the default shell for ssh sessions.
Invoke-WebRequest -OutFile OpenSSH-Win64.zip https://github.com/PowerShell/Win32-OpenSSH/releases/download/0.0.24.0/OpenSSH-Win64.zip;
Expand-Archive .\OpenSSH-Win64.zip;
$openSSHDir='C:\Program Files\OpenSSH';
md $openSSHDir;
mv .\OpenSSH-Win64\OpenSSH-Win64\* $openSSHDir;
powershell -ExecutionPolicy Bypass -File $openSSHDir\install-sshd.ps1;
$openSSHDir\ssh-keygen.exe -A;
powershell -ExecutionPolicy Bypass ". `'$openSSHDir\FixHostFilePermissions.ps1`' -Confirm:0";
New-NetFirewallRule -Protocol TCP -LocalPort 22 -Direction Inbound -Action Allow -DisplayName SSH;
Set-Service sshd -StartupType Automatic;

Keybase proof

I hereby claim:

To claim this, I am signing this object: