下載https://github.com/PowerShell/Win32-OpenSSH/releases
解壓放到C:\Program Files\OpenSSH-Win64
進入到C:\Program Files\OpenSSH-Win64
按住shift 和鼠標右鍵 運行cmd
powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1
設置服務自動啟動並啟動服務:
sc config sshd start= auto
net start sshd
然后會生成目錄和配置
配置文件在
C:\ProgramData\ssh
端口號: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
