Tailscale SSH lets you control SSH logins through your tailnet policy using Tailscale identities. Turn it on at the destination and make sure your policy allows the source to reach TCP port 22 and use the local account under an SSH rule. Tailscale SSH
Choose Tailscale SSH or OpenSSH over Tailscale
| Tailscale SSH | OpenSSH over Tailscale |
|---|---|
| Tailscale’s SSH server handles connections to port 22 on the host’s Tailscale IP. Tailscale authenticates the source and uses tailnet policy to authorize the login. Tailscale SSH | Your existing SSH server handles the login using its configured authentication. Tailscale provides the network path and controls which sources can reach the server over the tailnet. Protect your SSH servers using Tailscale |
| Use it when you want tailnet identities to control logins. A rule in check mode can require the user to sign in again. Tailscale SSH | Consider keeping OpenSSH if you rely on authorized_keys to restrict which commands remote users can run. Check mode applies only to Tailscale SSH. Tailscale SSH |
Check which devices can host a session
The server component requires Tailscale v1.24 or later on Linux or on macOS with the open-source tailscale and tailscaled CLI build. Synology and QNAP devices are excluded. A device reached through a subnet router still needs to run Tailscale itself to host Tailscale SSH. Tailscale SSH
Any device running Tailscale can initiate a connection, regardless of platform. Tailscale SSH
For the setup below, use a client and host on the same tailnet. If you still need to join your devices, follow the Tailscale setup guide.
Allow one login in Access controls
If you have permission to edit the tailnet policy, open Access controls in the admin console and use the JSON editor. Tailscale SSH · Visual policy editor reference
A grant with "ip": ["tcp:22"] allows traffic from the source to the destination on TCP port 22. The separate ssh rule authorizes the source to sign in as a specified account on the destination. Grants explained · Tailnet policy syntax
A broader grant can still allow traffic to the same destination, and another SSH rule may match a different login. Grants explained
Merge these entries into the corresponding sections of your existing policy. Replace operator@example.com with your Tailscale login from Users, and replace local-user with an existing non-root account on the host. SSH into a Linux VM
{
"tagOwners": {
"tag:server": ["operator@example.com"]
},
"grants": [
{
"src": ["operator@example.com"],
"dst": ["tag:server"],
"ip": ["tcp:22"]
}
],
"ssh": [
{
"action": "check",
"src": ["operator@example.com"],
"dst": ["tag:server"],
"users": ["local-user"]
}
]
}
srcis the tailnet identity that starts the connection. You can use an individual Tailscale login as shown or a definedgroup:<name>to match members of that group. Tailscale SSHdstis the destination. The tag selects devices carryingtag:server. For connections between devices owned by the same user, an SSH rule can useautogroup:selfwith a user or group source. Tailnet policy syntaxuserslists existing OS accounts on the destination. In this rule, the Tailscale identity can request thelocal-userlogin. Tailnet policy syntax
Apply the destination tag
- Save the policy with
tag:serverdefined intagOwners. Group devices with tags - Applying a tag to a user-owned device replaces its user identity with a tag-based identity. Group devices with tags
- To apply a tag as a tailnet Owner, Admin, or Network admin, find the host in Machines and open the menu at the far right of its row. Select Edit tags, add
tag:server, and select Save. Group devices with tags
Choose between check and accept
A check rule requires periodic sign-in through the user’s identity provider. The example leaves checkPeriod at its 12-hour default. When a check is due, SSH provides a sign-in URL. Tailscale SSH
An accept rule permits a matching login from a source already authenticated to the tailnet. For a tagged source device, use accept and a tagged destination. Tailscale SSH
See the Tailscale ACL examples for more policy patterns.
Enable Tailscale SSH on the destination
Run this command on the destination. Existing SSH connections to its Tailscale IP will hang when you run it. Tailscale SSH
tailscale set --ssh
Connect and verify the first login
From the client, use the host’s Tailscale IP from Machines and the local account allowed by the SSH rule. Replace the example address and username with yours. You can also use the host’s MagicDNS name. SSH into a Linux VM
ssh local-user@100.64.65.66
If the client uses userspace networking and cannot connect directly, use the Tailscale CLI form on a build that provides it. Tailscale CLI
tailscale ssh local-user@100.64.65.66
Open the sign-in URL on the initiating device if prompted and authenticate with your identity provider. Tailscale SSH
If the login fails, check these settings.
- Host setting. Confirm you enabled Tailscale SSH on the destination. Tailscale SSH
- Network permission. Confirm a grant or ACL lets the source reach TCP port 22 on that destination. Tailnet policy syntax
- Login permission. Check that an SSH rule matches the source, destination tag, and requested OS account. Verify the account exists on the host. Tailnet policy syntax
Evidence and limits. Tailscale’s official feature, policy, and CLI documentation was checked on November 28, 2026. No hands-on testing was performed for this guide. The feature guide documents server support starting with v1.24. Tailscale SSH