服务器端版本:Windows 10 V1909

01.在Windows PowerShell安装OpenSSH
https://github.com/PowerShell/Win32-OpenSSH/releases
安装:powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1
卸载:powershell.exe -ExecutionPolicy Bypass –File uninstall-sshd.ps1
02.生成rsa密钥对
ssh-keygen.exe -t rsa -f ca_userkeys


03.将ca_userkeys.pub公钥里面的内容复制到服务器(需要登录的)用户的目录下的.ssh文件夹的authorized_keys文件中
注:用于远程登录用户下的.ssh文件夹,需要手动新建一个

04.手动打开Windows防火墙中的SSH端口 port:22
在Windows防火墙中,默认情况下不放行SSH

5.启动/停止sshd服务
net start sshd
net stop sshd


Open SSH安装完成后,会在以下路径产生一个ssh的文件夹(该路径默认是隐藏的 C:\ProgramData\ssh)


6.客户端使用Win SCP中的SFTP,连接提示无法初始化SFTP协议