Skip to content

Match Group administrators is silently skipped for Entra ID administrators (keys read from per-user authorized_keys) #2466

Open

Description

@beadon

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Related: #1787 (SSH with AAD/Entra ID credentials). The behaviour below comes from PowerShell/openssh-portable#744, which made ga_init() non-fatal when no user token can be generated.

Steps to reproduce

  1. Entra ID–joined Windows 11 device; an Entra ID user (SID S-1-12-1-…) who is a member of the local Administrators group.
  2. Default %ProgramData%\ssh\sshd_config, which contains:
    Match Group administrators
           AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys
    
  3. Run sshd.exe 10.0.0.0p2 as SYSTEM (as the service does). For the logs below: sshd.exe -ddd -p 2223 -E log.txt from a SYSTEM scheduled task.
  4. Put the user's public key in C:\Users\<user>\.ssh\authorized_keys.
  5. ssh -p 2223 -l 'azuread\<user>' <host>

Expected behavior

The Match Group administrators block applies to an administrator, so their keys are looked up only in administrators_authorized_keys, as documented in OpenSSH key management. If group membership can't be determined, sshd should say so clearly rather than silently treating the user as a non-administrator.

Actual behavior

sshd can't create an S4U token for the Entra ID user (see #1787), so since #744 ga_init() reports the user as being in no groups. The Match Group administrators block is skipped for an Entra ID administrator, and the key is read from the per-user authorized_keys:

checking match for 'Group administrators' user azuread\\<user> host <client> ... lport 2223 on line 87
lookup_principal_name: User principal name lookup failed for user 'azuread\\<user>' (explicit: 1355, implicit: 1355)
debug1: generate_s4u_user_token: LsaLogonUser() failed. User 'azuread\\<user>' Status: 0xC0000062 SubStatus 0.
get_user_token - unable to generate token on 2nd attempt for user azuread\\<user>
ga_init, unable to resolve user azuread\\<user>
debug1: Can't Match group because user azuread\\<user> not in any group at line 87
debug3: match not found on line 87
Accepted key ED25519 SHA256:... found at C:/Users/<user>/.ssh/authorized_keys:1
Accepted publickey for azuread\\<user> from <client> port ... ssh2: ED25519 SHA256:...

(The session then fails with fork of unprivileged child failed, the S4U limitation tracked in #1787.)

Any other Match Group block an admin relies on (e.g. ForceCommand, ChrootDirectory, AllowTcpForwarding) is silently skipped for Entra ID users in the same way, because their membership always reads as "no groups".

Suggestion: when the token can't be generated, resolve membership another way (e.g. the account SID against the local group, including Entra role SIDs nested in Administrators), or at least log a warning that Match Group rules could not be evaluated for that user.

Environment data

Windows 11 Pro 25H2, build 10.0.26200, Entra ID–joined (AzureAdJoined: YES, DomainJoined: NO)
Windows PowerShell 5.1.26100

Version

OpenSSH_for_Windows_10.0p2 Win32-OpenSSH-GitHub, LibreSSL 4.2.0   (GitHub release 10.0.0.0p2-Preview, zip, run as SYSTEM)
Inbox OpenSSH_for_Windows_9.5 (sshd.exe 9.5.6.2) on the same machine fails earlier: ga_init() still calls fatal() there (pre-#744).

Activity

  1. github-actions commented on Oct 2, 2026

    @github-actions

    Thanks for the detailed report. This looks like an actionable Windows-specific sshd/authentication bug: when Entra ID user group resolution fails, Match Group administrators can be skipped silently and administrative-key policy can be bypassed.

    For maintainers
    • Windows-specific vs. parity: This belongs in PowerShell/openssh-portable as a Windows-specific bug, not an upstream OpenSSH issue. The reported failure depends on Entra ID/AAD SIDs, Windows S4U token generation, local Administrators membership, and the Windows port's ga_init()/group lookup behavior. Confidence: high.
    • Reproducibility: Reproducible from the report as written. It includes OpenSSH for Windows version (10.0p2 GitHub preview, with inbox 9.5.6.2 comparison), server/client environment detail for the Entra-joined Windows 11 machine, exact sshd_config condition, command/log excerpt, expected behavior, and actual behavior. Confidence: high.
    • Copilot-fix suitability: Maybe. The expected behavior is clear and likely localized around Windows group resolution / Match Group handling, but the right fix may involve Windows account/SID semantics and security-sensitive behavior, so maintainer design review is important.
    • Likely area: Area-sshd, Area-Authentication, and Area-Logging/Diagnostics. The issue affects server-side Match Group evaluation during authentication/authorization, and the fallback/logging behavior when group resolution cannot be evaluated.
    Related issues and notes
    • Related open issue: [Feature request] SSH with AAD credentials #1787 tracks broader SSH support limitations for AAD/Entra ID credentials and notes the same underlying Windows S4U-token limitation, including group information retrieval for Match group blocks.
    • I did not find a stricter open duplicate for this specific post-ga_init() behavior where an Entra administrator is treated as having no groups and per-user authorized_keys is accepted despite the default Administrators Match Group block.

    Generated by Agentic Issue Triage for issue #2466 · 62.7 AIC · ⌖ 28.7 AIC · ⊞ 20.1K · ◷

    Add this agentic workflows to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/issue-triage.md@2f03fdaafb8c1ae62dfde7e0be762a822a201aeb
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions