Windows SSH New-PSSession - subsystem request failed on channel 0

Ошибка появляется в момент попытки установки PowerShell сессии over SSH:

$session = New-PSSession -HostName xxx.xxx.xx.x -UserName pdebug
[email protected]'s password:
New-PSSession: [xxx.xxx.xx.x] The background process reported an error with the following message: The SSH client session has ended with error message: subsystem request failed on channel 0.

Решение

Необходимо в %programdata%\ssh\sshd_config добавить параметр:

Subsystem	powershell pwsh.exe -sshs -NoLogo -NoProfile

Windows Server 2019 (Lic) 2021-04-06 18-53-56

Перезапустить сервис sshd:

Get-Service -Name sshd | Restart-Service

Еще