Windows 2016
Sponsored Link

OpenSSH : Change Default Shell
2019/03/04
 
When login to OpenSSH Server from Clients, Command prompt runs as default Shell, but if you'd like to change it to PowerShell, Configure like follows.
[1] Run PowerShell on OpenSSH Server and Change setting.
# make sure the PATH of powershell command
PS C:\Users\Administrator> Get-Command powershell | Format-Table -AutoSize -Wrap 

CommandType Name           Version        Source
----------- ----           -------        ------
Application powershell.exe 10.0.14393.206 C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

# set DefaultShell=PowerShell in registry entry of OpenSSH
# for the PATH of PowerShell, specify the result of above
PS C:\Users\Administrator> New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -PropertyType String -Force 

DefaultShell : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
PSPath       : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\OpenSSH
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE
PSChildName  : OpenSSH
PSDrive      : HKLM
PSProvider   : Microsoft.PowerShell.Core\Registry
Matched Content
 
Tweet