From d55dd15b965edc5a51cce92162d0bc491e1e71b2 Mon Sep 17 00:00:00 2001 From: Felix Dallidet Date: Thu, 17 Sep 2020 14:54:18 +0200 Subject: [PATCH] Fixes #18220: Windows ssh setup should set powershell as default shell --- scripts/setup-ssh-windows.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/setup-ssh-windows.ps1 b/scripts/setup-ssh-windows.ps1 index ede19f0..2848595 100644 --- a/scripts/setup-ssh-windows.ps1 +++ b/scripts/setup-ssh-windows.ps1 @@ -43,6 +43,11 @@ if ($frule) { Write-output "Creating new firewall rule for ssh server" New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 } + +# Set default shell + New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -PropertyType String -Force + New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShellCommandOption -Value "/c" -PropertyType String -Force + # Restart service Start-Service sshd