Repository navigation
Description
Problem
At reviewed main 632d12a127253b33cdf35d9a132aef3aaf4df5fd, SSH port 22 is hardcoded in five related places: installer preflight, generated OpenSSH configuration, startup banner probe, package-update listener ownership check, and package-update readiness probe. A user-level installation therefore fails its preflight when the kernel's unprivileged-port threshold is 1024, even though a higher port could be used.
The nncme fork patch changes all five places to 2222. This is useful evidence of a portability requirement, not a reason to replace upstream's default or to treat that fork as a validated existing-install migration.
Evidence
- Installer preflight
- Generated SSH configuration and startup probe
- Update listener check and readiness check
- The current updater contract deliberately preserves SSH configuration and restarts only the shim.
Proposed minimal scope
- Retain 22 as the default and preserve existing installations' behavior.
- Allow an explicit SSH port choice for a new installation, persisted in one validated installation setting rather than independent source edits or a transient startup environment override.
- Make installer preflight, generated sshd configuration, startup/diagnostic output, and update listener/readiness checks use the same effective value.
- Validate integer/range, the current kernel's unprivileged-port threshold, and conflicts with the transport shim (18089), configured local proxies, and an unrelated occupied listener. Do not silently select another port or kill another process.
- Preserve loopback-only OpenSSH, public-key authentication, host keys, node state, and Tailscale SSH disabled by default.
- Before package code replacement, check compatibility with the installed SSH configuration. Unsupported or ambiguous configurations/candidates must stop with an actionable error rather than producing mixed port expectations. Retain current manifest, transaction, binary-baseline, and independent-recovery-terminal safeguards.
- Document the selected port in client SSH commands, host-key onboarding, and the requirement for separately reviewed tailnet policy. Port selection is not proof of external reachability.
Acceptance criteria
- Without an option, new and existing port-22 installations keep current behavior.
- An explicitly selected high port such as 2222 is retained across restart and supported package updates; all five checks/configuration paths agree.
- Missing/legacy configuration has a documented backward-compatible interpretation; malformed or conflicting configuration is rejected before mutation.
- Boundary regressions cover selected ports 22/2222 and thresholds 0/1024/2222/2223, invalid values, reserved/conflicting/occupied ports, and no silent fallback.
- Install/start/update tests verify generated configuration and probe destinations, identity preservation, and rejection of incompatible candidates before replacing code.
- Existing Python 3.11/3.13 offline suite, source-manifest, Bash syntax, and ShellCheck checks remain applicable. Mocked/isolated tests are not described as live tailnet or external SSH validation.
- Usage guidance stays consistent across supported languages and distinguishes local readiness from separately verified external SSH access.
Non-goals and boundaries
No automatic conversion of an existing port-22 installation, implicit SSH restart/migration, sysctl/capability/root/TUN change, ACL change, authentication reset, key regeneration, public exposure, or arbitrary updater-repository selection. A future explicit existing-install port migration needs its own reviewed recovery procedure. This issue does not diagnose the cause of any current external SSH/ping failure.
Related work
Existing diagnostics (#17/#26), source updates (#30), and security-baseline migration (#57) are already implemented; this issue is specifically about SSH-port configuration and compatibility. Checked the repository's 62 existing issues/PRs (open and closed) on 2026-10-29; no duplicate SSH-port configurability issue was found.
Activity