brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: use action check in a Tailscale SSH rule for a re-login

Network and access
~/tips/tip-tailscale-ssh-check

"ssh": [

Makes Tailscale SSH ask for a fresh identity check before a login, with a period you choose.

Not every SSH login should be free just because the device is on your tailnet.

A Tailscale SSH rule has an action. accept lets in anyone already authenticated to the tailnet. check makes the user re-authenticate through the identity provider first.

"ssh": [
  {
    "action": "check",
    "src": ["autogroup:member"],
    "dst": ["autogroup:self"],
    "users": ["autogroup:nonroot"],
    "checkPeriod": "8h"
  }
]

checkPeriod accepts minutes or hours from 1 minute to 168 hours, and defaults to 12 hours. The value always asks on every connection. When both an accept and a check rule match, check wins.

Notice autogroup:nonroot in users. The docs warn that if you change the destination away from autogroup:self, you should review that line, or anyone matched by the source could log in as any non-root user there.

Caveats: tagged sources cannot use check mode, and always can break automation like Ansible that opens many connections quickly. It only covers Tailscale SSH, not plain SSH over the tailnet.

I would use check on anything that holds data I care about, and accept on the throwaway machines. That split is cheap to write and it makes the sensitive boxes harder to wander into.

Further reading: Tailscale SSH, On this site: turn on Tailscale SSH with tailscale set –ssh, On this site: put a tests block in your Tailscale policy file, On this site: Guide: manage your Unraid server from anywhere with Tailscale and no open ports

More Network and access tips scp -3 alice@server-a:/var/backups/db.sql.gz bob@server-b:/srv/restore/ tailscale exit-node suggest tailscale lock sign nodekey:1abddef1 tlpub:abcdef12 wg genpsk > peer1.psk Table = off All Network and access tips (163) All topics

Link