Skip to main content

Seeing the public node key of a Tailscale node

  • Tagged with tailscale
  • Posted

I’ve been doing some work on Tailscale key expiry, in particular renewing keys with tailscale up --force-reauth. As part of this work, I want to see when a node key has (or hasn’t) changed.

I’ve found some CLI commands that let me see the current node key. Note that these use unstable interface, so these commands might break on newer versions – I’m using v1.88.1.

Seeing your own node key

This is the public key of the current node:

$ tailscale status --self --json | jq -r .Self.PublicKey
nodekey:46f9c8656ef1224b5ce5220fbdf96ce38e52aaabeccc9b7358b06481e9481821

Here’s what the key prefixes mean:

Seeing a peer’s node key

This is the public key of the linode-vps node:

$ tailscale debug netmap | jq -r '.Peers | map(select(.ComputedName == "linode-vps")) | .[].Key'
nodekey:731cd9e2560f29c655b674e4033d7cdffeb210aea917b225099b2d601533502d

I’m sure this is possible with tailscale status --peers --json, but that doesn’t include MagicDNS names so it’s a bit less convenient for me – plus, I already had this command working.