Page:
DefaultShell
Pages
About Win32 OpenSSH and Design Details
Area Owners
Build OpenSSL
Building OpenSSH for Windows (using LibreSSL crypto)
Building Win32 OpenSSH on Linux
Certificate Authentication
DefaultShell
Deploy Win32 OpenSSH
Difference between openssh 5.9p1 and nomachine implementation
Dos2Unix Text file format converters
Eclipse CDT and GDB setup to debug SSH tools
FIDO U2F usage
Home
How to retrieve links to latest packages
Install Win32 OpenSSH Using MSI
Install Win32 OpenSSH
Intro Links for Penetration Testing
Logging Facilities
Migrate sshd_config from older versions
OpenSSH 32 bit Build and Installation Instructions
OpenSSH 64 bit Build and Installation Instructions
OpenSSH build sequence
OpenSSH utility scripts to fix file permissions
Project Scope
Project Status
Run OpenSSH Pester Tests
Run commands for various shells
Running Tests
SSH remote sessions on Windows
Security protection of various files in Win32 OpenSSH
Setting up a Git server on Windows using Git for Windows and Win32_OpenSSH
Setup public key based authentication for windows
TTY PTY support in Windows OpenSSH
Troubleshooting Steps
Various Considerations
Win32 OpenSSH RoadMap
[Deprecated] Building using VS 2015
[Deprecated] Win32 OpenSSH Automated Install and Upgrade using Chocolatey
sftp.exe examples
ssh agent
ssh.exe examples
ssh
ssh_config
sshd
sshd_config
11
DefaultShell
Yanbing edited this page 2020-03-05 12:37:50 -08:00
Before configuring DefaultShell
, ensure the following prerequisites are met
- OpenSSH installation path is in system PATH.
- If not already present, amend system PATH and restart sshd service.
Follow these steps:
- On the server side, configure the default ssh shell in the windows registry.
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\OpenSSH\DefaultShell
- full path of the shell executableComputer\HKEY_LOCAL_MACHINE\SOFTWARE\OpenSSH\DefaultShellCommandOption
(optional) - switch that the configured default shell requires to execute a command, immediately exit and return to the calling process. By default this is-c
.Computer\HKEY_LOCAL_MACHINE\SOFTWARE\OpenSSH\DefaultShellEscapeArguments
(optional) - flag that allow you to skip escaping the arguments of default shell. By default this is0
. This option is only applicable to shells other than powershell, bash, cygwin, cmd, and ssh-shellhost.exe.
Examples:
- Powershell cmdlets to set powershell bash as 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
- Powershell cmdlets to set custom default shell and skip escaping of argument
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\temp\GetCommandLine.exe" -PropertyType String -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShellCommandOption -Value "/c" -PropertyType String -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShellEscapeArguments -Value 1 -PropertyType DWORD -Force
- If you are configuring the powershell.exe/cmd.exe/WSL-bash.exe as default ssh shell, your registry should look like this.
Manuals
Installation
- MSI Install Instructions
- Script Install Instructions
- Alternative installation using the universal installer
- Retrieving download links for the latest packages
Usage
- SSH Usage Examples
- SFTP Usage Examples
- Using Certificate Authentication
- Fix SSH file permissions
- Info on SSH remote sessions on Windows
- TTY PTY support
- Troubleshooting