ssh: connect to host 192.168.1.100 port 22: Connection refused fatal: Could

下载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

https://www.cnblogs.com/ddif/p/10020454.html

猜你喜欢

转载自blog.csdn.net/github_38108899/article/details/92664880