filmov
tv
How to Install OpenSSH on Windows Server 2019 or 2022
Показать описание
How to Install OpenSSH on Windows Server 2019 or 2022
1. Using Windows PowerShell
Open PowerShell as an Administrator.
2.
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'
3. Install OpenSSH Client:
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
4. Install OpenSSH Server:
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
5. Configure Firewall
- Open the Windows start menu, locate and click Server Manager. In the Server Manager window, navigate to Tools, and select Windows Defender Firewall with Advanced Security from the drop-down list.
- Now, click Inbound Rules in the open Firewall window. Then, select New Rule from the right pane.
In the New Inbound Rule Wizard, select Port from the list of options, then click Next. Select ‘TCP’, then enter port 22 in the Specific local ports: section.
- Next, allow the connection, assign the rule to server profiles, and set a custom name for easy identification from the list of Firewall rules.
Click Finish to save the new firewall rule.
6. Start-Service sshd
restart-Service sshd
7. Set-Service -Name sshd -StartupType 'Automatic'
8. To configure OpenSSH, use the following command to open the main configuration file in Notepad and make your preferred changes.
start-process notepad C:\Programdata\ssh\sshd_config
9. Login to Windows Server using SSH
$ ssh -l Administrator SERVER-IP -p port
1. Using Windows PowerShell
Open PowerShell as an Administrator.
2.
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'
3. Install OpenSSH Client:
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
4. Install OpenSSH Server:
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
5. Configure Firewall
- Open the Windows start menu, locate and click Server Manager. In the Server Manager window, navigate to Tools, and select Windows Defender Firewall with Advanced Security from the drop-down list.
- Now, click Inbound Rules in the open Firewall window. Then, select New Rule from the right pane.
In the New Inbound Rule Wizard, select Port from the list of options, then click Next. Select ‘TCP’, then enter port 22 in the Specific local ports: section.
- Next, allow the connection, assign the rule to server profiles, and set a custom name for easy identification from the list of Firewall rules.
Click Finish to save the new firewall rule.
6. Start-Service sshd
restart-Service sshd
7. Set-Service -Name sshd -StartupType 'Automatic'
8. To configure OpenSSH, use the following command to open the main configuration file in Notepad and make your preferred changes.
start-process notepad C:\Programdata\ssh\sshd_config
9. Login to Windows Server using SSH
$ ssh -l Administrator SERVER-IP -p port
Комментарии