close

在Windows裡面,如果要用SSH連進Windows,在OS裡,就要安裝OpenSSH

以Windows Server 2019為例,在這開啟Windows PowerShell

【學習筆記】如何安裝適用於 Windows Server 2019 和 Windows 10 的 OpenSSH

執行安裝OpenSSH Server指令

Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

【學習筆記】如何安裝適用於 Windows Server 2019 和 Windows 10 的 OpenSSH

安裝完成後,可以從Services上看到OpenSSH SSH Server

其中預設安裝好Windows Server 2019就會有OpenSSH Authentication Agent股務

【學習筆記】如何安裝適用於 Windows Server 2019 和 Windows 10 的 OpenSSH

設定股務自動啟動:

Set-Service sshd -StartupType Automatic

Set-Service ssh-agent -StartupType Automatic

Start-Service sshd

Start-Service ssh-agent

【學習筆記】如何安裝適用於 Windows Server 2019 和 Windows 10 的 OpenSSH

在安裝OpenSSH Server 時如果有出現類似下面錯誤訊息,那可能表示需要安裝某些更新

Add-WindowsCapability -Online -Name OpenSSH.Server ~~~~ 0.0.1.0
Add-WindowsCapability:Add-WindowsCapability失敗。錯誤代碼= 0x800f0950

Windows update 之後就可以安裝了!

測試使用PuTTY連進Windows Server 2019

【學習筆記】如何安裝適用於 Windows Server 2019 和 Windows 10 的 OpenSSH

鍵入Windows登入帳密,就可以進入了!

【學習筆記】如何安裝適用於 Windows Server 2019 和 Windows 10 的 OpenSSH

arrow
arrow

    金好康-好康資訊 發表在 痞客邦 留言(0) 人氣()