Skip to content

Instantly share code, notes, and snippets.

@11philip22
Last active November 5, 2019 13:26
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 11philip22/44cccced313d6371bc52307684138b57 to your computer and use it in GitHub Desktop.
Save 11philip22/44cccced313d6371bc52307684138b57 to your computer and use it in GitHub Desktop.
install ssh in powershell on windows aws ec2
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
C:\ProgramData\chocolatey\bin\choco.exe install openssh
mkdir C:\ProgramData\ssh
cp 'C:\Program Files\OpenSSH-Win64\sshd_config_default' C:\ProgramData\ssh\sshd_config
cd "C:\Program Files"
.\OpenSSH-Win64\ssh-keygen.exe -f C:\ProgramData\ssh\ssh_host_dsa_key -t dsa
.\OpenSSH-Win64\ssh-keygen.exe -f C:\ProgramData\ssh\ssh_host_rsa_key -N '' -t rsa
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
.\OpenSSH-Win64\sshd -D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment