Jenkins 通过 SSH 连接 Windows
详细配置步骤
1.安装OpenSSH Server
Windows系统默认安装 OpenSSH Client,但是没有 OpenSSH Server
位置:
应用和功能->管理可选功能->添加功能->OpenSSH Server- 等待添加完成,大概几分钟
2.验证OpenSSH可用
powershell
Get-WindowsCapability -Online | ? Name -like 'OpenSSH*'3.开启SSHD服务
powershell
Start-Service sshd- 配置开机自启动
powershell
Set-Service -Name sshd -StartupType 'Automatic'- 确认防火墙
OpenSSH-Server-In-TCP是enabled就行
powershell
Get-NetFirewallRule -Name *ssh*4.使用ssh连接即可
shell
ssh user@windows-server-ip使用场景
- Jenkins通过ssh配置Windows Agent.
