Created
February 9, 2024 16:54
-
-
Save ph20/a6ece6b56f5da272aa7ade215340ad9a to your computer and use it in GitHub Desktop.
Install ssh server on windows
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
# enable/instgall sshd server | |
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 | |
# Start the SSH service | |
Start-Service sshd | |
# OPTIONAL: Set the SSH service to start automatically | |
Set-Service -Name sshd -StartupType 'Automatic' | |
# Add a firewall rule to allow SSH connections | |
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 | |
# Check the SSH service status | |
Get-Service sshd | |
# Confirm the OpenSSH Server feature is installed | |
Get-WindowsCapability -Online | ? Name -like 'OpenSSH.Server*' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment