OpenSSH is a popular open-source tool that allows secure remote administration of your Windows system. This guide demonstrates how to install and configure the OpenSSH Server on a Windows machine using PowerShell commands.
-
Check if OpenSSH is already installed:
where ssh
is used in Command Prompt (CMD) to check if OpenSSH is already installed. This command will search for the SSH executable.
-
Check and Install OpenSSH in PowerShell:
- In PowerShell, you can use the following commands to check if OpenSSH is available and install it if not.
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'
lists the available OpenSSH capabilities.Add-WindowsCapability -Online -Name OpenSSH.Server*
installs the OpenSSH Server feature.Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'
is run again to verify the installation.
-
Start the OpenSSH Server service:
Start-Service sshd
is used to start the OpenSSH Server service.
-
Set OpenSSH Server service to Automatic startup:
Set-Service -Name sshd -StartupType 'Automatic'
sets the OpenSSH Server service to start automatically when the system boots.
-
Stop the OpenSSH Server service (optional):
net stop sshd
is an optional command to stop the OpenSSH Server service.
Remember to run these commands with administrative privileges.