Windows Remote
2026-04-01
新闻来源:网淘吧
围观:12
电脑广告
手机广告
Windows 远程控制
通过 SSH 在远程 Windows 机器上执行命令。
配置
在~/.openclaw/openclaw.json文件中的skills.windows-remote.env下设置环境变量:

{
"skills": {
"windows-remote": {
"env": {
"WINDOWS_SSH_HOST": "192.168.1.100",
"WINDOWS_SSH_PORT": "22",
"WINDOWS_SSH_USER": "Administrator"
}
}
}
}
或直接导出:
export WINDOWS_SSH_HOST="192.168.1.100"
export WINDOWS_SSH_PORT="22"
export WINDOWS_SSH_USER="Administrator"
快速命令
检查连接
scripts/win-exec.sh "echo connected"
GPU 状态
scripts/win-exec.sh "nvidia-smi"
运行 PowerShell
scripts/win-exec.sh "powershell -Command 'Get-Process | Select-Object -First 10'"
执行脚本
scripts/win-exec.sh "python C:\\path\\to\\script.py"
脚本参考
win-exec.sh
在远程 Windows 机器上执行单个命令。
scripts/win-exec.sh "<command>"
win-gpu.sh
快速检查 GPU 状态(nvidia-smi 封装器)。
scripts/win-gpu.sh
scripts/win-gpu.sh --query # Compact output
win-upload.sh
通过 SCP 上传文件到远程机器。
scripts/win-upload.sh <local-file> <remote-path>
win-download.sh
从远程机器下载文件。
scripts/win-download.sh <remote-path> <local-file>
常见任务
检查 Ollama 是否正在运行
scripts/win-exec.sh "tasklist | findstr ollama"
启动服务
scripts/win-exec.sh "net start <service-name>"
使用 GPU 运行 Python
scripts/win-exec.sh "python -c \"import torch; print(torch.cuda.is_available())\""
检查磁盘空间
scripts/win-exec.sh "wmic logicaldisk get size,freespace,caption"
故障排除
| 问题 | 解决方案 |
|---|---|
| 连接被拒绝 | 检查 SSH 服务:Get-Service sshd |
| 权限被拒绝 | 验证 SSH 密钥位于~/.ssh/authorized_keys或administrators_authorized_keys |
| 连接超时 | 检查防火墙规则,验证 IP/端口 |
| 命令未找到 | 使用完整路径或在 Windows 上检查 PATH |
安全注意事项
- 使用 SSH 密钥而非密码
- 妥善保管私钥 (chmod 600)
- 考虑使用Tailscale进行跨网络访问
文章底部电脑广告
手机广告位-内容正文底部
上一篇:WHO Growth Charts
下一篇:Cat Fact


微信扫一扫,打赏作者吧~