Skip to content

Latest commit

 

History

History

Open-SSH

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Installing OpenSSH on Windows Server 2016

  1. Download the latest OpenSSH release from Microsoft’s Powershell Gallery on github.

    https://github.com/PowerShell/Win32-OpenSSH/releases

  2. Install OpenSSH with the following command:

powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1
  1. Set Firewall rule on server:
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
  1. Start firewall service:
net start sshd
  1. Make startup type for sshd service to automatic
Set-Service sshd -StartupType Automatic

Here is the above commands and outputs in action:

Post SSH install

Enabling SSH with password authentication (not recommended)

  1. Stop sshd service and modify the sshd_config file in C:\Program Files\OpenSSH

  2. Allow Password Authentication by uncommenting the line below:

Only allow access via Active Directory Security Group. In this example access is limited to Active Directory users that are apart of lab\sshusers group.

  1. Modify the ssh firewall rule for remote connections to only accept traffic over SFTP via Port 22 to subnets that need access an example is below:

References

Installation of OpenSSH For Windows Server 2019 and Windows 10

https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse