Skip to content

Linux: map serve/funnel access-denied to a PERMISSION_DENIED error with the operator remedy #54

Closed

Description

@TMHSDigital

Why it matters

On Linux, tailscaled runs as root and only root or the configured operator can change Serve/Funnel config. A normal user running the MCP server gets an access-denied error from tailscale serve, and the server reports it as a generic CLI_ERROR with the remedy "run the command manually to reproduce". The fix is one well-known command, and this project's whole error design is built to hand users exactly that kind of command.

Evidence

  • src/providers/cli.ts:174-188 (failFromCli) recognizes only daemon-unreachable text. Everything else becomes CLI_ERROR.
  • TailscaleErrorCode (src/providers/types.ts:96-101) has no permission code.
  • README has no Linux note about operator permissions for share_port/stop_share.
  • Non-operator users get an "access denied" style error from serve/funnel. The exact wording should be captured as a fixture from a real CLI (see Weekly contract tests against the real tailscale CLI to catch output-format drift #47).

Suggested approach

  • Add a PERMISSION_DENIED code. Map /access denied|permission denied/i from serve, funnel, or reset to it, with the remedy sudo tailscale set --operator=$USER.
  • Add a README "Linux" note under Serve/Funnel.
  • Add fixture tests for the denied path on serve, funnel, and serve reset.

Done when

A non-operator Linux user calling share_port gets PERMISSION_DENIED with the operator command, covered by tests and documented.

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

    bugpriority: P2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions