Last active
November 5, 2019 13:26
-
-
Save 11philip22/44cccced313d6371bc52307684138b57 to your computer and use it in GitHub Desktop.
install ssh in powershell on windows aws ec2
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
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