PowerShell / PowerShell/Win32-OpenSSH
After installing OpenSSH connecting to the host fails because sshd can't create the shell process running in user context
Open
Nobody has claimed this yet.
Area-ssh
Investigate
- Dominant language
- No language data
- Stars
- 8.3k
- Forks
- 819
- PR merge metrics
- No merged PRs in 30d
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest version
- Search the existing issues.
Steps to reproduce
- Install the latest OpenSSH v9.1.0.0p1-Beta from https://github.com/PowerShell/Win32-OpenSSH/releases/download/v9.1.0.0p1-Beta/OpenSSH-Win64-v9.1.0.0.msi
- Configure sshd
- start sshd from services
- connect to this host with ssh @localhost
- watch the connection succeed, but then terminate after some time without giving access to the configured shell
Expected behavior
Connect and start PowerShell.exe, pwsh.exe or cmd.exe
Actual behavior
Connection succeeds, but then terminates, because no shell could be started.
Error details
Within sshd logs you'll find lines like:
debug3: mm_request_send: entering, type 13
Accepted password for adm-sct-muc from ::1 port 56232 ssh2
debug1: monitor_child_preauth: user adm-sct-muc authenticated by privileged process
debug3: mm_get_keystate: Waiting for new keys
debug3: mm_request_receive_expect: entering, type 26
debug3: mm_request_receive: entering
debug3: mm_get_keystate: GOT new keys
debug3: mm_auth_password: user authenticated [preauth]
debug3: user_specific_delay: user specific delay 0.000ms [preauth]
debug3: ensure_minimum_time_since: elapsed 84665.000ms, delaying 24818.373ms (requested 6.682ms) [preauth]
debug3: send packet: type 52 [preauth]
debug3: mm_request_send: entering, type 26 [preauth]
debug3: mm_send_keystate: Finished sending state [preauth]
debug3: ReadFileEx() ERROR:109, io:000001F315A90A50
debug3: read - no more data, io:000001F315A90A50
debug3: spawning "C:\\Program Files\\OpenSSH\\sshd.exe" -dddd -z as user
CreateProcessAsUserW failed error:1314
fork of unprivileged child failed
debug1: do_cleanup
sshd fails to spawn a child within the context of the user and as this user.
### Environment data
```PowerShell
> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.17763.3770
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.3770
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Version
v9.1.0.0p1-Beta
Visuals
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.