在windows安装ssh
Easul Lv6
BASH
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 在如下网址找到最新版本的ssh
# https://github.com/PowerShell/Win32-OpenSSH/releases
# 这里下载的是 v9.2.2.0p1-Beta
wget https://github.com/PowerShell/Win32-OpenSSH/releases/download/v9.2.2.0p1-Beta/OpenSSH-Win64.zip
# 然后可以解压到 C:\Program files 文件夹
# 在 administrator 用户下在 OpenSSH 文件夹下的命令行输入如下命令
# 安装 sshd
powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1
# 开放22号端口(如果你在windows关闭了防火墙并配置了入站规则可以不执行如下命令,多执行不影响)
netsh advfirewall firewall add rule name=sshd dir=in action=allow protocol=TCP localport=22
# 配置开机自启sshd服务
sc config sshd start= auto
# 启动ssh
net start sshd

参考

 评论