Skip to content

feat(ssh): support an explicit operator-trusted SSH configuration file #312

Closed

Description

@abruption

Problem

In a restricted user-namespace environment, the default OpenSSH client configuration can fail ownership checks before a connection is attempted. An operator-selected configuration can also be needed for userspace-networking transport through a verified local Tailscale socket. session-peer currently has no supported way to select such a file without changing the user's default SSH configuration.

At v1.1.2 / f3993bf8988dd301b7e14402e63e8ac04e5e2300 (also the reviewed current main), --ssh-opt deliberately rejects -F and ProxyCommand. This is an important security boundary, not an allowlist bug.

Sanitized evidence and limits

The user reported OpenSSH rejecting a system include with a bad-owner/permissions error. That default-config failure was not freshly reproduced in this diagnostic pass. Fresh inspection established:

  • In the inspected Linux namespace, uid_map and gid_map were 1000 0 1; overflowuid was 65534. The relevant system SSH include was visible as UID 65534 with mode 0644. Other system files also appeared with that UID. The original host-side owner was not established.
  • OpenSSH client version was 10.0p2.
  • A separately created operator-owned configuration parsed successfully for two explicitly selected aliases with ssh -v -G -F <OPERATOR_CONFIG> <ALIAS>, exit 0. The diagnostic read only the dedicated configuration and retained StrictHostKeyChecking=yes, UpdateHostKeys=no, ForwardAgent=no, PermitLocalCommand=no, and BatchMode=yes.
  • The dedicated configuration used ProxyCommand <TAILSCALE_BINARY> --socket=<VERIFIED_LOCAL_SOCKET> nc %h %p.

A bounded transport-only check on 2026-10-15 around 00:30 UTC then reached SSH key exchange for both selected aliases. Both received SSH2_MSG_KEX_ECDH_REPLY and an ED25519 host key, then exited 255 because strict host-key checking rejected an unknown host. One server banner was OpenSSH_10.3; the other identified Tailscale, so this is not a claim that both endpoints were ordinary macOS OpenSSH servers.

Sanitized command shape (replace placeholders with reviewed local values):

c='<OPERATOR_CONFIG>'
for h in '<ALIAS_A>' '<ALIAS_B>'; do
  timeout 20s ssh -vvNT -F "$c" \
    -oConnectTimeout=10 -oConnectionAttempts=1 \
    -oIdentityFile=none -oIdentityAgent=none "$h"
  echo "EXIT=$?"
done

This establishes the tested transport and SSH key-exchange stages only. No host key was enrolled, no authentication was completed, and no remote command or session discovery was performed. Disabling identity-file/agent use was deliberate for this transport-only probe; it does not establish that authentication would be impossible with separately authorized credentials. A received key is not a trusted or independently verified key.

Proposed scope

Add a separately trusted, explicit operator configuration mechanism, for example --ssh-config <PATH>, rather than allowing -F or executable directives through --ssh-opt.

Define its authority separately from untrusted host/options/message/reply inputs. SSH configuration can contain executable Match/ProxyCommand directives, including execution during ssh -G, so document that selecting this file grants local code-execution authority. File ownership alone does not establish human authorization.

Use one validated configuration selection consistently for effective-user metadata, bounded handoff preflight, host-identity checks, discovery/doctor, dispatch, installed-version probes, and explicit remote updates. Preserve original-alias handling, HostName/HostKeyAlias behavior, command quoting, deadlines, and existing unknown/no-automatic-resend semantics. Do not forward the local configuration path into remote commands or reply URIs.

Acceptance criteria

  • Existing --ssh-opt rejection tests remain intact, including -F, ProxyCommand, Include, Match exec, KnownHostsCommand, and host-key-verification bypasses.
  • Default behavior is unchanged. The selected configuration has a clear trusted-operator contract; untrusted messages/reply URIs and MCP tool arguments cannot choose arbitrary files. If MCP support is included, configure it at the operator/server-policy boundary.
  • Missing, unreadable, or unsafe selections are rejected before any subprocess. Define ownership, permissions, symlink and path-handling rules, including spaces and platform differences. Do not claim the selected file makes transitive includes or executable commands safe.
  • Fixtures verify that all relevant SSH entry points receive the same selection; identity enforcement and strict host-key verification are not weakened or silently bypassed.
  • No default SSH/system configuration edits, PATH-shadowing wrapper recommendation, credential copying, or automatic key enrollment.
  • Documentation distinguishes configuration validation, TCP/banner, host-key verification, authentication, remote Python, and actual session discovery. Authorized live acceptance records only stages actually completed.

Related work and source

This is an opt-in capability request motivated by an environment limitation, not evidence that session-peer caused the namespace ownership mapping. No implementation, deployment, milestone assignment, or release is implied.

Activity

  1. added
    priority:P2
    on Oct 15, 2026
  2. added this to the v1.3.0 milestone on Oct 15, 2026
  3. abruption commented on Oct 26, 2026

    @abruption
    OwnerAuthor

    v1.3.0 release closeout — 2026-10-26

    Closing as completed for the owner-approved release scope, following the owner's milestone cleanup instruction. The original proposal/checklist is retained as history; this is not a blanket assertion of every platform or broader research guarantee.

    Explicit operator-trusted POSIX SSH configuration selection is published. Common forward entry points revalidate the selection; strict host-key checks, reverse-probe isolation, path redaction and known-submission/update evidence are preserved.

    Evidence: merged PR #330; published v1.3.0 scope, source 938630063b69bf6e0ae69d4b11e2095c30f289f4; successful publication and artifact/install verification. Static source/test-definition recheck today: tests/core/test_ssh_config_cli.py; tests/core/test_ssh_config_storage.py. Two read-only subagent audits independently reviewed the split issue groups; no new mandatory closure blocker was found. No new tests/live experiments or deployment were performed during this closeout.

    Remaining boundaries: Configuration commands and transitive Includes remain operator-trusted, not sandboxed. Windows/setup/paired/Reply-To/preset/MCP selection is excluded. The original restricted namespace and authenticated live remote scenario were not newly reproduced; tests and CI are not operational acceptance.

    Retain the closed issue in v1.3.0 as the release record. Optional excluded expansions are not automatically promised for another release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:P2

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions