# 安装OpenSSH服务器 Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 # 启动 + 设置开机自启 Start-Service sshd Set-Service -Name sshd -StartupType Automatic # 放行22端口防火墙 New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22