使用 Windows 内置的 OpenSSH 客户端

Windows 自 1809 起就内置完整的 OpenSSH 客户端——日常 SSH 不再需要 PuTTY。

WindowsSSH 远程连接网络命令行低风险
在任意终端(PowerShell 或 cmd)运行 ssh user@host;密钥和配置位于 %userprofile%\.ssh。

01命令

命令
$ ssh -p 2222 admin@example.com

02作用说明

很多 Windows 用户仍出于习惯安装 PuTTY,但 ssh.exe、scp.exe 和 sftp.exe 自 Windows 10 1809 起就是可选内置组件,在新版本中默认启用。它读取与 Linux 上 OpenSSH 相同的 ~/.ssh/config、id_ed25519 密钥和 known_hosts,因此工具链和 CI 脚本可以原样迁移。运行 ssh -V 确认客户端存在,ssh-agent 则作为 Windows 服务运行,可设为自动启动。

03风险

风险低风险
使用条件OpenSSH Client is a Windows optional feature, enabled by default on Windows 10 1809+/11; verify with ssh -V

04撤销

✓无需撤销——该命令不会改变持久状态。

05来源

  • SSH key management for OpenSSH on Windows
    Microsoft Learn · vendor-doc · 2026-09-17
    依据: Confirms the OpenSSH client ships with Windows, documents its config location (%userprofile%\.ssh) and usage of ssh-keygen and ssh-agent.

最后验证: 2026-09-17 · 分类: 开发者

06相关方案