提问人:Adnan Bin Zahir 提问时间:8/7/2023 更新时间:8/7/2023 访问量:135
无法通过 Powershell 7 使用 SSH
Cannot use SSH using Powershell 7
问:
当我尝试使用 powershell 7 使用 ssh 时,它会抛出并出错:
ssh: The term 'ssh' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
但它适用于 cmd 和 windows powershell
我还注意到我无法将目录更改为 OpenSSH (C:\Windows\System32\OpenSSH)
我尝试将Openssh添加到系统路径中,安装openssh客户端和服务器,但没有工作。
我该如何解决?
答:
1赞
Adnan Bin Zahir
12/12/2023
#1
我终于解决了这个问题。
安装 PowerShell 时,我曾经选中启用 PowerShell 远程处理的框。但是,这次我没有,现在SSH可以工作了。
解决方案如下:
- 如果未安装 OpenSSH(甚至在 cmd 中不起作用),请先按照以下步骤操作: 适用于 Windows 的 OpenSSH 入门
- 卸载 PowerShell。
- 下载安装程序:PowerShell 最新版本。
- 在安装过程中,请确保未选中“PowerShell 远程处理”框。
这就是我所要做的。
评论
adnan
where ssh.exe
Get-Alias -Name ssh
Get-Alias -Name ssh
Get-Alias: This command cannot find a matching alias because an alias with the name 'ssh' does not exist.