OpenAI Codex · tool · fg-0502

codex login on a remote or headless machine never completes the browser sign-in

If you see Browser sign-in started over SSH never returns to Codex, the cause and the fix for OpenAI Codex are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
Browser sign-in started over SSH never returns to Codexcodex login --device-auth is unavailable until device code login is enabled
Cause
The default ChatGPT sign-in opens a browser on the same machine and returns credentials to it. Device code login works remotely but must first be enabled in ChatGPT security settings, or by a workspace admin.
Fix
Enable device code login and run codex login --device-auth, or sign in on a machine with a browser and copy ~/.codex/auth.json when file credential storage is used. For automation, pipe an API key to codex login --with-api-key.
Apply
codex login --device-auth
Affected
Codex CLI, device code authentication in beta, as of 2026-10
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun