#3508·headscale

[Bug] ssh: removing ssh access does not apply

Author: gabriel-vasileCreated Sep 28, 2026Updated Sep 28, 2026
Labelsbug

Is this a support request?

  • This is not a support request

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Removing given ssh access by deleting the ssh key in the ACL policy file does not block subsequent ssh connections.

Expected Behavior

Removing given ssh access by deleting the ssh key in the ACL policy file blocks subsequent ssh connections.

Steps To Reproduce

  1. policy.mod = database
  2. have two machines to act as the ssh server and ssh client
  3. start with a policy file that does not allow ssh and confirm tailscale ssh will not connect
json
{
  "acls": [],
}
  1. assign ssh access to a user and confirm tailscale ssh connects
json
{
  "acls": [],
  "ssh": [
    {
      "action": "accept",
      "src": ["autogroup:member"],
      "dst": ["autogroup:self"],
      "users": ["root"],
    },
 ],
}
  1. return the policy to the original version from 3. that does not allow ssh
  2. tailscale ssh still accepts connections

Environment

markdown
- OS: linux
- Headscale version: v0.29.4
- Tailscale version: v1.102.4

Runtime environment

  • Headscale is behind a (reverse) proxy
  • Headscale runs in a container

Debug information

The root cause seems to be this early return nil, nil. https://github.com/juanfont/headscale/blob/99cbba7aff2bd78c62486212f6968c0cca62870c/hscontrol/policy/v2/filter.go#L261-L263 A nil *tailcfg.SSHPolicy means for callers no update is needed.

I think the fix is to make it return &tailcfg.SSHPolicy{}, nil. I can submit a pr with the fix and a test for it. Let me know if it should be fixed a different way.