我可以使用默认 shell pwsh.exe 登录 Windows OpenSSH 吗?

我可以使用默认 shell pwsh.exe 登录 Windows OpenSSH 吗?

我无法登录 Windows OpenSSH,因为我的默认 shell 是不是powershell。如果是,那么

reg add HKLM\SOFTWARE\OpenSSH /v DefaultShell /d C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe

使登录工作正常。

但是,gitlab 使用 bash,而 power shell 上没有 bash,所以它使用 pwsh.exe。但是,如果我设置

New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "$PSHOME\pwsh.exe" -PropertyType String -Force

正如这里建议的那样https://docs.gitlab.com/runner/executors/virtualbox.html,那么 SSH 登录将不起作用。如果我保留 powershell.exe,那么它可以工作,但不能使用 bash

相关内容