Windows 安装 SSH 服务端

安装 下载 OpenSSH 以管理员身份打开 PowerShell 并进入 OpenSSH 目录 允许 PowerShell 脚本执行 Set-ExecutionPolicy Bypass -Scope Process -Force 运行安装脚本, 注册 SSH 服务端. .\install-sshd.ps1 启动服务 Start-Service sshd 开机自启 Set-Service sshd -StartupType Automatic 查看服务 Get-Service sshd 放行端口 New-NetFirewallRule -Name sshd -DisplayName "OpenSSH Port 22" ` -Protocol TCP -Direction Inbound -LocalPort 22 -Action Allow 测试, 必须要有密码, Windows 不允许空密码 ssh Administrator@IP 卸载 停止服务 Stop-Service sshd Stop-Service ssh-agent 卸载服务 .\uninstall-sshd.ps1 删除 OpenSSH 文件夹 检查 Get-Service sshd 返回以下内容 ...

2025-12-03 · Last Updated 2025-12-04 · Commit a0d24b4