Key expiry & auth keys
Two related concepts. Key expiry forces periodic re-auth on devices. Auth keys let you bring up devices non-interactively. Both matter for production setups.
1Key expiry: re-auth every 180 days
By default, when a device joins your tailnet, its node key (the WireGuard key) is valid for 180 days. After that, the device needs to re-authenticate.
This is a security feature: a long-lost laptop that never re-auths drops off your tailnet automatically. You'll see the device flagged "key expired" in the admin console, and other devices can no longer reach it.
- Re-authenticate: open Tailscale on the device โ log in again. Or run
tailscale up. - Disable expiry on a specific device: admin console โ device โ "Disable key expiry." Useful for headless servers you don't want to babysit.
- Change the duration: admin console โ Settings โ adjust. Can range from days to years.
2Auth keys (recap from M3L6)
Auth keys are pre-shared keys that let a device join your tailnet without an interactive browser login. Generate them at admin console โ Settings โ Auth keys. They're how you provision headless servers, containers, or fleets.
Options when generating:
- Reusable: register many devices vs. single-use
- Ephemeral: device auto-removes when offline
- Pre-authorized: skips manual approval (if device approval is enabled)
- Tags: which tags the device gets โ important for ACL alignment
- Expiration: 1 hour to 90 days
3OAuth clients (production fleets)
For really long-lived production setups, the better pattern is an OAuth clientOAuth client โ a Tailscale credential that can mint new auth keys via API. Used by automation (Terraform, CI) to provision devices on demand without human interaction. โ a credential that can mint auth keys on demand via API. This is how Terraform, CI/CD systems, and large fleet managers integrate with Tailscale.
Most personal users won't need this. The combination of one long-lived auth key (rotated quarterly) and disabled key expiry on stable servers covers 95% of self-hosting needs.
4Hygiene
- Treat auth keys like passwords. Don't paste them in shared chats. Don't commit them.
- Use single-use keys for one-off provisions.
- Use ephemeral keys for short-lived containers or CI runners.
- Disable key expiry only on devices you trust to remain trustworthy (an always-on server in your house, sure; a laptop someone could steal, no).
- Periodically review the Machines page. Remove anything you don't recognize.
5Module recap
You now know every major Tailscale feature: tags, ACLs, Serve, Funnel, exit nodes, subnet routers, certs, key expiry. The next module is M5 โ operations and security, including patterns for production-style ACLs and what to do if things go wrong.