SagerNet / SagerNet/sing-box

Tailscale SSH cannot switch local users with the default systemd capabilities

Open Beginner friendly
#4,523 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
38.1k
Forks
4.6k
Avg merge
19d 15h
Merged PRs (30d)
1

Description

Environment
  • CachyOS (Arch-based), Linux x86_64
  • sing-box 1.14.0
  • Command-line program running through systemd
  • Local user's shell: /bin/fish
Problem

After enabling Tailscale SSH and allowing a normal local user through the SSH policy, connecting from another tailnet device authenticates successfully, but the shell fails to start:

failed to open shell: fork/exec /bin/fish: operation not permitted

The installed service has the same user and capability settings as upstream's release/config/sing-box.service:

User=sing-box
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_RAW CAP_NET_BIND_SERVICE CAP_SYS_PTRACE CAP_DAC_READ_SEARCH
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_RAW CAP_NET_BIND_SERVICE CAP_SYS_PTRACE CAP_DAC_READ_SEARCH
Verified workaround

Adding this systemd drop-in, which extends the existing capability lists with CAP_SETUID and CAP_SETGID, and restarting the service fixes the problem:

[Service]
CapabilityBoundingSet=CAP_SETUID CAP_SETGID
AmbientCapabilities=CAP_SETUID CAP_SETGID

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read release/config/sing-box.service and compare its CapabilityBoundingSet and AmbientCapabilities with the documented Tailscale SSH failure. Verify that the service can start a shell for a switched local user after the capability configuration is updated, while preserving existing proxy operation.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux
Domain
operating-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.