Handback

Guides

Logins on a machine you aren't looking at

Command-line tools sign you in through a browser, and expect that browser to be on the same machine. On a remote or headless box it isn't. These guides show how to finish each login by hand, checked against each tool's own docs.

  1. OAuth

    OAuth redirect to localhost on a remote server: why the login hangs, and how to finish it

    A CLI login on a remote box sends your browser to localhost and stops. Why, and four ways to finish it: paste-back, device code, ssh -L, Handback.

  2. Claude Code

    Claude Code login on a remote server over SSH

    Signing Claude Code in on a box you reach over SSH: the paste-code flow, copying a wrapped URL, claude auth login, setup-token, API keys, MCP sign-ins.

  3. Codex

    Codex login on a headless server

    Signing the Codex CLI in on a remote or headless box: device code auth, an ssh tunnel for port 1455, an API key on stdin, or copying auth.json.

  4. gcloud

    gcloud auth login without a browser

    Authorize the gcloud CLI on a machine with no browser: --no-browser and its two-machine flow, --no-launch-browser, and application-default login.

  5. GitHub CLI

    gh auth login on a headless server

    GitHub CLI's browser login is already a device code, so it mostly works over SSH. How to finish it, when to use GH_TOKEN, and where tokens are stored.

  6. SSH

    Open a link from an SSH session on your phone

    Why a link opened on a box you SSH into goes nowhere, how $BROWSER and xdg-open decide, and how to get it onto your phone: copy, QR code, or Handback.