中文
VPS/VDS 主机

在 Windows VPS 上安装 OpenSSH Server

在 Windows Server 上启用 OpenSSH,用于 SSH/SFTP 与密钥登录。

中级约 1 分钟阅读

除 RDP 外,OpenSSH 为 Windows VPS 提供 SSH/SFTP 管理。

📋 前提条件

  • 具有管理员权限的 Windows Server;如需放行 22 端口见防火墙。

安装功能

管理员 PowerShell:

PowerShell
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH.Server*' Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

启动服务

PowerShell
Start-Service sshd Set-Service -Name sshd -StartupType Automatic Get-Service sshd

Windows 防火墙

规则通常会自动创建,否则:

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

从本机测试

替换 VPS_IP 与 Windows 用户名:

Bash
ssh USER@VPS_IP

SFTP: sftp USER@VPS_IP

我们的 Windows VPS 同样提供 8 个位置:法国 Windows VPS、德国 Windows VPS、荷兰 Windows VPS、英国 Windows VPS、美国 Windows VPS、加拿大 Windows VPS、土耳其 Windows VPS 和 香港 Windows VPS。 也提供桌面版:Windows 10 RDP 和 Windows 11 RDP。

安全

  • 优先使用 SSH 密钥
  • 限制允许账户
  • 配合初始配置与更新

祝使用顺利!🚀

最新教程

及时了解最新的优惠、折扣和特别促销活动。

查看促销

我们使用Cookie

我们使用 Cookie 来衡量和改进本网站。 隐私政策