Cursor CLI login via SSH/Mosh

Where does the bug appear (feature/product)?

Cursor CLI

Describe the Bug

I’m on Mac OS, and I have TailScale and Mosh set up. On my iPhone, I have Terminus. This sets up a VPN and I can use a terminal from my laptop. However, I cannot login. Copying the URL and opening a browser on the host SEEMS to be successful, but I end up just getting “failed to store authentication tokens.” When setting the environment variable CURSOR_API_KEY, it just silently fails. Running “agent status” gives “Not Logged In.” Claude Code does not have any problems.

Steps to Reproduce

  1. brew install mosh
  2. Enable remote login on macos; disable password login
  3. Install TailScale on both iPhone and MacOS
  4. Get ssh key in terminus. Add to authorized_keys on mac
  5. Login to Mac on Terminus
  6. Run “agent” or “agent login”

Expected Behavior

This should either use the environment variables. OR like claude code open a browser on the host to login

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

agent --version
2026.01.09-231024f

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey, thanks for the report. This is a known issue with cursor-agent on macOS over SSH. macOS Keychain can’t store tokens in a remote session.

Workaround: start tmux or zellij locally on your Mac (via physical access or Screen Sharing), then SSH into that session. If the terminal session is created locally, auth works.

About CURSOR_API_KEY, the team knows this doesn’t work as expected in headless or SSH scenarios. We’re working on a fix.

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.