tailscale/tailscale · warning
usage: tailscale ssh [user@]<host>
Error message
usage: tailscale ssh [user@]<host>
What it means
runSSH requires at least one positional target argument. With len(args) == 0 it returns a usage error immediately — no connection or name resolution is attempted. The accepted form is [user@]host, with extra args forwarded to ssh itself.
Source
Thrown at cmd/tailscale/cli/ssh.go:55
The 'tailscale ssh' wrapper adds a few things:
* It resolves the destination server name in its arguments using MagicDNS,
even if --accept-dns=false.
* It works in userspace-networking mode, by supplying a ProxyCommand to the
system 'ssh' command that connects via a pipe through tailscaled.
* It automatically checks the destination server's SSH host key against the
node's SSH host key as advertised via the Tailscale coordination server.
`),
Exec: runSSH,
}
func runSSH(ctx context.Context, args []string) error {
if runtime.GOOS == "darwin" && version.IsMacAppStore() && !envknob.UseWIPCode() {
return errors.New("The 'tailscale ssh' subcommand is not available on macOS builds distributed through the App Store or TestFlight.\nInstall the Standalone variant of Tailscale (download it from https://pkgs.tailscale.com), or use the regular 'ssh' client instead.")
}
if len(args) == 0 {
return errors.New("usage: tailscale ssh [user@]<host>")
}
arg, argRest := args[0], args[1:]
username, host, ok := strings.Cut(arg, "@")
if !ok {
host = arg
username = ""
}
st, err := localClient.Status(ctx)
if err != nil {
return err
}
prefs, err := localClient.GetPrefs(ctx)
if err != nil {
return err
}
View on GitHub (pinned to cfe32b8be6)
Solutions
- Pass a target: `tailscale ssh user@host` (user@ is optional)
- Guard variables in scripts: `: "${DEST:?destination required}"` before the call
Example fix
// before $ tailscale ssh usage: tailscale ssh [user@]<host> // after $ tailscale ssh admin@server
Defensive patterns
Strategy: validation
Validate before calling
if dest == "" {
return errors.New("tailscale ssh requires [user@]<host>")
} Prevention
- Guard destination variables: `: "${DEST:?required}"`
- Validate the [user@]host form before invoking
When it happens
Trigger: `tailscale ssh` with no arguments; a script interpolating an empty destination variable (`tailscale ssh "${DEST}"`). The macOS App Store check runs first, so on those builds you'd see the platform error instead.
Common situations: Empty variables in automation; forgetting the destination after `tailscale ssh`; shell functions that conditionally append the host.
Related errors
- unexpected arguments
- expected at least one argument
- expected at least one argument after method
- expected exactly one integer argument
- unexpected arguments
AI-assisted analysis of tailscale/tailscale@cfe32b8be6 (2026-08-15).
Data as JSON: /api/errors/6cc6e7d1cb3d5fc5.
Report an issue: GitHub.