Created
December 15, 2020 23:01
-
-
Save zactodd/4c6b4f124290f2e1d39fe4ec81a8bfa9 to your computer and use it in GitHub Desktop.
enable windows ssh
This file contains hidden or 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
Get-WindowsCapability -Online | ? Name -like 'OpenSSH*' | |
# If OpenSSH client or server are not installed run the following | |
# Install the OpenSSH Client | |
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0 | |
# Install the OpenSSH Server | |
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 | |
Start-Service sshd | |
Set-Service -Name sshd -StartupType 'Automatic' | |
# Confirm the Firewall rule is configured. It should be created automatically by setup. | |
Get-NetFirewallRule -Name *ssh* | |
# There should be a firewall rule named "OpenSSH-Server-In-TCP", which should be enabled | |
# If the firewall does not exist, create one | |
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment