返回指南列表
主机配置

Windows 远程登录

在 Windows 10、Windows 11 或 Windows Server 上开启 OpenSSH Server,让 Redock 可以通过 SSH 连接。

Redock 连接 Windows 走的是 SSH,不是远程桌面。要把 Windows PC 作为 Redock Host,需要开启 Microsoft OpenSSH Server,启动 sshd 服务,并确保 iPhone 或 iPad 能访问 TCP 22 端口。

准备条件

  • 使用 Windows 10、Windows 11、Windows Server 2019、Windows Server 2022 或 Windows Server 2025。
  • 当前账号有安装可选功能的权限。
  • iPhone 或 iPad 和 Windows PC 位于同一局域网、Tailscale 网络、ngrok TCP endpoint,或其他可达网络路径。
  • 长期使用建议配置 SSH Key。

通过设置安装

  1. 打开 Settings。
  2. 搜索 Optional Features。
  3. 打开 Add an optional feature。
  4. 搜索 OpenSSH Server。
  5. 安装 OpenSSH Server。
  6. 打开 Services。
  7. 找到 OpenSSH SSH Server。
  8. 将 Startup type 设为 Automatic。
  9. 启动服务。

安装 OpenSSH Server 通常会创建允许 TCP 22 入站的 Windows 防火墙规则。如果 Redock 无法连接,先检查这条规则是否启用。

通过 PowerShell 安装

以管理员身份打开 PowerShell,执行:

Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH.Server*'
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Start-Service sshd
Set-Service -Name sshd -StartupType Automatic

如果防火墙规则缺失,可以创建:

New-NetFirewallRule -Name OpenSSH-Server-In-TCP -DisplayName "OpenSSH Server (sshd)" -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22

检查服务状态:

Get-Service sshd

找到 Windows 地址

同一局域网下,可以查看 Windows IP:

ipconfig

使用当前 Wi-Fi 或有线网卡的 IPv4 地址,例如 192.168.1.35

确认 Windows 用户名:

whoami

如果 whoami 输出 DESKTOP-1234\alex,Redock 里可以先尝试填写 alex。域账号或受管账号需要使用当前 Windows OpenSSH 配置接受的账号格式。

Redock Host 配置

Name: Windows PC
Host: 192.168.1.35
Port: 22
Username: alex
Connection Mode: SSH
Auth: Password 或 SSH Key

连接成功后通常会进入 Windows 为 OpenSSH 配置的默认 shell。路径和命令是 Windows 风格,例如:

cd C:\Users\alex\Projects\my-app
git status

Windows 上的 SSH Key

如果使用 key 认证,把 Redock public key 添加到:

C:\Users\alex\.ssh\authorized_keys

确认这个文件属于对应 Windows 用户。如果 key 被拒绝,可以在 Event Viewer 里查看 OpenSSH 日志,并检查 .sshauthorized_keys 的权限。

常见问题

  • Connection refused:sshd 没有运行、22 端口被阻断,或防火墙规则未启用。
  • Connection timed out:IP 地址错误、设备不在同一网络,或网络阻断入站 TCP。
  • Authentication failed:检查 Windows 用户名、密码、SSH key 和账号策略。
  • command not found:需要在 Windows 上安装 Git、Node、Python 或 AI coding agent,并确认它在 OpenSSH shell 的 PATH 中。

官方参考

跟着指南在 Redock 里试一下

用手机控制 Coding Agent,随时进行开发

免费获取 Redock