Win Server2019安裝SSH sftp
目錄
1.下載微軟官方的open-Ssh
從GitHub上下載Open-SSH
2.解壓到一個盤中 並把文件夾重命名為OpenSSH

3.配置環境變量

4.安裝Open-SSH
install-sshd.ps1 使用這個腳本安裝(需要用管理員運行)
5.生成密鑰
ssh-keygen -t rsa -C “lwq202@yeah.net”
6.查看生成的密鑰
more .ssh.pub
7.為SSHD服務啟用自動啟動,然后使用以下PowerShell服務管理命令啟動它:
Set-Service -Name sshd -StartupType ‘Automatic’
Start-Service sshd
8.開啟防火牆
New-NetFirewallRule -Protocol TCP -LocalPort 22 -Direction Inbound -Action Allow -DisplayName SSH
