A server logged in with my own account shares my identity: rules for me apply to it, and its key expires like a laptop’s. For servers I’d rather use a tag.
sudo tailscale up --advertise-tags=tag:server --force-reauth
The tags page of the Tailscale docs uses this command, and tailscale login --advertise-tags=tag:server works as well. Several tags go in one comma-separated list: --advertise-tags=tag:server,tag:development.
The tag must exist first. You define it under tagOwners in the tailnet policy file, and only its owners (or admins) can apply it:
"tagOwners": {
"tag:server": ["autogroup:admin"]
}
What changes: the docs say applying a tag removes user-based authentication, since a device has tags or a user, not both. You then write ACL rules for tag:server instead of for a person. And when you tag a device and authenticate it for the first time, its key expiry is turned off by default.
Caveats. Off by default is not off for good: key expiry can be switched back on in the admin console. You cannot remove every tag from a device again. If the device was added with an auth key, the docs say to make a new key instead of changing tags with this flag. And tagged devices can only use Tailscale SSH to other tagged devices, which surprised me the first time I read it.
Further reading: Tailscale: tags, Tailscale CLI reference, On this site: put a tests block in your Tailscale policy file