windowserver 2012安装openssh


下载https://github.com/PowerShell/Win32-OpenSSH/releases
解压放到C:Program FilesOpenSSH-Win64

进入到C:Program FilesOpenSSH-Win64

按住shift 和鼠标右键 运行cmd

powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1


设置服务自动启动并启动服务:
sc config sshd start= auto
net start sshd

然后会生成目录和配置

配置文件在
C:ProgramDatassh
端口号:Port 22
密钥访问:PubkeyAuthentication yes
密码访问:PasswordAuthentication no
空密码:PermitEmptyPasswords no

C:Users账户名.ssh目录,创建authorized_keys公钥文件(也可在ssh_config修改路径)

参考
http://www.cnblogs.com/chengchen/p/9610819.html
https://www.jianshu.com/p/6e5bc39d386e

原文地址:https://www.cnblogs.com/ddif/p/10020454.html