Skip to content

Instantly share code, notes, and snippets.

@lengocthuong15
Created September 7, 2021 09:20
Show Gist options
  • Save lengocthuong15/87de7869a6b5dce63b49dbf94c9c222c to your computer and use it in GitHub Desktop.
Save lengocthuong15/87de7869a6b5dce63b49dbf94c9c222c to your computer and use it in GitHub Desktop.
Configuring the default shell for OpenSSH in Windows

The commands for check and set default shell for OpenSSH in Windows via PowerShell.

Sets the default shell to be powershell.exe

New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -PropertyType String -Force

Sets the default shell to be wsl

New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\WINDOWS\System32\bash.exe" -PropertyType String -Force

Check the default shell

Get-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment