Lock down SSH with Tailscale

Optional, off by default, about 5 minutes. You can undo it any time.

What it does

Today your server accepts SSH logins from the whole internet. They need your SSH key (passwords are off), and fail2ban blocks anyone who keeps guessing. With the lockdown, the SSH door is closed to the internet completely: only devices on your own private Tailscale network (your phone, your laptop) can reach it.

Why it is more secure

Nobody on the internet can even try to log in, so a leaked key, a future SSH bug or a guessing bot has nothing to talk to. Your bot keeps working: Telegram and Claude only need connections that start from the server.

Steps (from Telegram)

  1. Tell your bot: lock down SSH.
  2. Install the Tailscale app on your laptop (and phone if you like) from tailscale.com/download and sign in. It is free for personal use.
  3. Your bot sends you a login link. Open it and sign in with the same Tailscale account. Your server joins your network.
  4. Your bot sends you a command like ssh -i <your SSH key> army@100.101.102.103 (the same key you use for the server today). Run it in a terminal on your laptop and keep that window open. This is the one step that needs your own terminal: it proves the new door works before the old one closes.
  5. Tell your bot done. It checks that your login over Tailscale is really there, and only then closes public SSH.

From then on you log in with ssh -i <your SSH key> army@<the 100.x address> (Tailscale on). The KAppMaker MCP on your computer uses the same address.

Steps (in a terminal on the server)

sudo kappmaker-army-tailscale-lockdown

It installs Tailscale, joins your network, asks you to test a login from a second terminal, and locks only after you type yes.

Undo

Tell your bot undo the SSH lockdown, or run sudo kappmaker-army-tailscale-lockdown --undo. Public SSH (key only) is open again. If Tailscale is down and you cannot get in, use your provider's web console and run the undo command.

Docs for the App Army kit. The Claude Code plugin has its own page.