Skip to content

Support a non-default SSH port per node #118

Closed

Description

@TMHSDigital

Summary

The SSH port is hard-coded to 22. Nodes whose sshd runs on another port (a common hardening step that the ssh-management skill mentions), or that are reached through a forwarded port, cannot be managed.

Where

  • mcp-server/src/utils/ssh-api.ts:381 (port: 22)
  • mcp-server/src/utils/ssh-api.ts:60 (NodeConfig has no port), :144 (registry entries)
  • skills/ssh-management/SKILL.md:105 ("port 22 (or custom SSH port)")

Proposal

  • Add HOMELAB_PI_PORT (default 22) and an optional numeric port field in HOMELAB_NODES entries.
  • Validate 1-65535 when parsing the registry; pass it to connect.
  • Show user@host:port in homelab_sshTest and the port in homelab_nodeList.
  • Document it in mcp-server/README.md and .env.example; add registry tests.

Who benefits

Anyone who moved sshd off 22 or uses a jump/forwarded port. Today they cannot use the server at all for that node.

Acceptance criteria

  • Default node and registry nodes connect on a configured port.
  • Invalid ports produce a clear configuration error.

Getting started

  • Relevant files: mcp-server/src/utils/ssh-api.ts, mcp-server/src/utils/__tests__/ssh-api.test.ts
  • How to run tests: cd mcp-server && npm install && npm test

Filed by repo-audit/full-audit at a59395f. Severity: medium. Effort: S. audit-key: enhancement|mcp-server/src/utils/ssh-api.ts|port

Activity

  1. added
    enhancement
    good first issue
    severity: medium
    on Nov 18, 2026
  2. TMHSDigital commented on Nov 18, 2026

    @TMHSDigital
    OwnerAuthor

    Fixed in f1efae9. HOMELAB_PI_PORT (default node) and an optional port in HOMELAB_NODES entries are passed to the SSH connection (default 22); invalid values give an error naming the setting. sshTest shows user@host:port, nodeList shows non-default ports. Verified with registry, validation and connect-port tests (377 passing).

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

    enhancementgood first issuemcp-serverseverity: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions