Skip to content

codex gets stuck at sudo step running on Ubuntu #6108

Open

Description

@nv186000

What version of Codex is running?

codex-cli 0.53.0

What subscription do you have?

Pro

Which model were you using?

gpt 5 codex

What platform is your computer?

Linux 6.8.0-59-generic x86_64 x86_64

What issue are you seeing?

When Codex executes a command requiring sudo privileges, the terminal enters a password prompt state where user keyboard input does not register properly. The prompt appears, but input is either partially displayed or not accepted at all. The session becomes unresponsive to normal keyboard input.

Observed Behavior

Codex runs a command that triggers sudo

Terminal displays password for : prompt

User attempts to type password

Input is not accepted (random characters appear or nothing appears)

Terminal becomes effectively frozen

Pressing Esc repeatedly sometimes restores control, but often fails even if it restore control keyboard input is only taken in partially

In many cases only Ctrl+C works, and sometimes the entire session must be closed

After force-closing, user must run codex resume to continue

it is not clear whether codex is actually working or it is waiting for a password . even if it is waiting for a password we cannot provide it as inout does not work

Image Image Image

What steps can reproduce the bug?

Start a Codex CLI session on Ubuntu

Let it do some trivial stuff

Then let cidex do something that needs a sudo privilege like sudo docker ( does not really matter as long as sudo is involved)

Terminal shows password prompt

User tries to type password

Terminal freezes / does not accept input

Press Escape many times some times it work sometime it does not , if it works try to type anything and whatever you input will not appear on screen fully

What is the expected behavior?

Password input should be accepted normally, or

Codex should detect interactive sudo context and:

Prompt user for password securely, or

Fall back to non-interactive mode with proper guidance

Additional information

No response

Activity

  1. added
    bug
    on Nov 2, 2025
  2. github-actions commented on Nov 2, 2025

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. tfriedel commented on Nov 4, 2025

    @tfriedel

    I also observed this issue. Very annoying!
    I also don't understand why it should get sudo permissions at all.
    If I manually run sudo before, programs will not ask for sudo password for some time. I though this could be a workaround.
    But then I see this:

      └ sudo: The "no new privileges" flag is set, which prevents sudo from running as root.
        sudo: If sudo is running in a container, you may need to adjust the container configuration to disable the flag.
    

    Seems like it's running in some container as root?

  4. added
    tool-calls
    on Nov 15, 2025
  5. InfinityZ25 commented on Feb 20, 2026

    @InfinityZ25

    just ran into this in ubuntu, really annoying

  6. sstklen commented on Feb 24, 2026

    @sstklen
  7. SuperJMN commented on Mar 16, 2026

    @SuperJMN

    It's happening to me. Whenever I want codex run some "sudo" command, it doesn't allow me to type the password, so it's always stuck on some tasks, like debugging driver problems.

  8. xyehya commented on Apr 4, 2026

    @xyehya

    A workaround for linux users:

    Run sudo visudo to edit the sudoers file
    Add a line for your user:
    your_username_here ALL=(ALL) NOPASSWD: ALL

    Note: This has significant security implications and should ideally be restricted to specific commands like
    NOPASSWD: /usr/bin/apt-get)

  9. ichi4096 commented on Sep 16, 2026

    @ichi4096

    A workaround for linux users:

    Run sudo visudo to edit the sudoers file Add a line for your user: your_username_here ALL=(ALL) NOPASSWD: ALL

    Note: This has significant security implications and should ideally be restricted to specific commands like NOPASSWD: /usr/bin/apt-get)

    https://gtfobins.org/gtfobins/apt-get/#shell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugtool-calls

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions