[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
- policy.mod = database
- have two machines to act as the ssh server and ssh client
- start with a policy file that does not allow ssh and confirm
tailscale sshwill not connect
{
"acls": [],
}- assign ssh access to a user and confirm
tailscale sshconnects
{
"acls": [],
"ssh": [
{
"action": "accept",
"src": ["autogroup:member"],
"dst": ["autogroup:self"],
"users": ["root"],
},
],
}- return the policy to the original version from 3. that does not allow ssh
tailscale sshstill accepts connections
Environment
- OS: linux
- Headscale version: v0.29.4
- Tailscale version: v1.102.4Runtime 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.
Source: juanfont/headscale