You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

执行PowerShell安装sshd脚本报错:install-sshd.ps1文件不存在

解决PowerShell找不到install-sshd.ps1文件的问题

核心原因

报错直接说明你当前执行命令的目录里没有install-sshd.ps1这个脚本文件,PowerShell无法定位到它。

分步解决方法

1. 确认脚本的真实位置

  • 如果你是手动下载的脚本,先找到它在电脑里的具体路径,比如C:\downloads\install-sshd.ps1
  • 如果你是要安装Windows自带的OpenSSH服务,默认脚本路径通常是:C:\Windows\System32\OpenSSH\install-sshd.ps1

2. 使用完整路径执行命令

把命令里的文件名替换成完整路径,示例:

PowerShell -ExecutionPolicy Bypass -File "C:\Windows\System32\OpenSSH\install-sshd.ps1"

或者先切换到脚本所在目录再执行:

cd "C:\Windows\System32\OpenSSH"
PowerShell -ExecutionPolicy Bypass -File install-sshd.ps1

3. 更简单的替代方案(无需找脚本)

如果你的目标是安装OpenSSH服务以实现PyCharm终端访问,直接用管理员身份运行PowerShell,执行以下命令即可:

# 安装OpenSSH服务
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
# 启动服务
Start-Service sshd
# 设置开机自启
Set-Service -Name sshd -StartupType 'Automatic'

验证是否成功

执行Get-Service sshd命令,若显示服务状态为Running,说明服务已正常运行,之后即可在PyCharm中配置SSH终端。

内容的提问来源于stack exchange,提问作者W1nter

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.29 10:23:13