解压后,重命名到 C:\Program Files\OpenSSH
通过管理员身份的方式打开 powershell , 并在 powershell 里面执行下面命令
1. 安装 OpenSSH
cd "C:\Program Files\OpenSSH"
powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1
2. 设置防火墙(未开启可跳过)
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
3. 启动 OpenSSH
net start sshd
4. 设置 OpenSSH 自启
Set-Service sshd -StartupType Automatic
ssh 登录的账户密码与登录 windows 系统的账户密码一致
Siri设置快捷指令
添加 脚本
通过ssh运行脚本
设置主机IP地址 用户名 密码
输入关机命令shutdown /s /t 0
如果想延迟几秒关机可以将0设置为你想要的数字时间
One comment
厉害