Auth keys let a server join your tailnet without a browser login. Typing one on the command line leaves it in your shell history and in the process list. The CLI can read it from a file instead.
Save the key in a file only root can read, then point to it with the file: prefix:
sudo install -m 600 /dev/null /root/ts-authkey
sudo nano /root/ts-authkey
sudo tailscale up --auth-key=file:/root/ts-authkey
The help text says that when the value begins with file:, it is read as a path to a file holding the key.
When you create the key in the admin console, think about the options. A one-off key works once; a reusable one joins many machines. Ephemeral removes the device when it goes offline, which suits containers and CI runners. Tags assign the device to a tag right away. And a key expires after at most 90 days, so a script that runs much later needs a new one.
Once the device has joined, the key is no longer needed on it. I’d delete the file afterwards, because a reusable key lying around on a server can add any machine to your tailnet.
Further reading: Auth keys, tailscale up command