Terminal-style graphic showing the Ansible Ubuntu 26.04 sudo-rs password prompt timeout error

Ansible Ubuntu 26.04 Timeout: Why sudo-rs Breaks the Become Password and How to Fix It

Ansible Ubuntu 26.04 runs can fail at the very first task with “Timeout (12s) waiting for privilege escalation prompt,” but only when sudo needs a password. The culprit is sudo-rs, the Rust rewrite of sudo that Ubuntu now ships, which prints an extra string before the prompt Ansible is waiting for. The proper fix is in Ansible Core 2.22.0, and there are two quick workarounds if you can’t upgrade today.

Here are the facts worth knowing before you touch anything:

  • Symptom: the “Gathering Facts” task fails after you enter the become password, for example with ansible-playbook main.yml -K.
  • Trigger: sudo asks for a password. Per Jeff Geerling’s write-up, the failure happens only in that case.
  • Cause: sudo-rs adds text ahead of the password prompt, so Ansible never sees the prompt it expects.
  • Fix: Ansible Core 2.22.0, with backports reportedly going into 2.16, 2.18, 2.19 and 2.20.
  • Stop-gap: point Ansible at the traditional sudo.ws binary, or switch the system’s sudo alternative.

If you run playbooks against Ubuntu servers from a laptop, you’re the person this affects.

Why Ansible Ubuntu 26.04 runs hang at the become password

Ansible’s sudo become plugin works by watching for a specific password prompt. The old sudo, called sudo.ws in this context, captured the PAM prompt and rewrote it, and the plugin leans on that behavior.

According to the Ansible issue tracking this, sudo-rs instead prints an additional string before handing off to PAM. The result is a prompt the plugin doesn’t match, something like [sudo: [sudo via ansible, key=...] password:] Password:. The same thread notes that sudo-rs didn’t support the -p prompt flag until version 0.2.5.

Ubuntu began making sudo-rs the default with 25.10, as Ubuntu’s announcement describes. Geerling hit the problem on 26.04 after moving servers over from Ubuntu 22 and 24 during 2026. He posted the details on November 25.

Three ways to fix it, from cleanest to quickest

You can fix this on the Ansible side or the server side. Upgrading is the cleanest because it leaves the servers alone.

Option Where you change it The catch
Upgrade Ansible Your control machine Distro-packaged versions may lag behind
Set ansible_become_exe=sudo.ws Your inventory, per host Each target needs sudo.ws installed
Switch the sudo alternative Each server Moves the whole host off sudo-rs, not just Ansible

First, find out what you’re dealing with. Running sudo --version on a server shows which sudo it uses, and update-alternatives --display sudo lists the options installed. That tells you whether the sudo.ws workaround is even available on that host before you plan around it.

Geerling says pip install -U ansible restored the -K flag for him. If you’d rather not upgrade yet, add the per-host override to your inventory like this:

dell-precision.local ansible_become_exe=sudo.ws

To change the whole server instead, run the alternatives menu on that host and pick the traditional sudo:

sudo update-alternatives --config sudo

The per-host inventory setting is the more surgical choice, because it changes only what Ansible calls.

Who has to fix it: Ansible, not Ubuntu

Don’t wait for Ubuntu to change sudo-rs. A Launchpad bug report on the timeout lists the rust-sudo-rs package as “Won’t Fix” and Ubuntu’s ansible-core as “In Progress.”

The same report shows the problem against ansible-core 2.19.0-1ubuntu1 on Ubuntu 25.10. If you installed Ansible from apt, a newer version in a Python virtual environment is the easiest way to get the fix sooner.

It isn’t only Ansible, either. Geerling says pyinfra hit the same wall, and its fix is in pyinfra 3.11.

What nobody has pinned down yet

A few details remain open. Geerling names 2.16, 2.18, 2.19 and 2.20 for backports and says 2.21 is possible but unconfirmed. His post doesn’t give the exact sudo-rs version on 26.04 either.

We also couldn’t confirm the 2.22.0 release date from Ansible’s own documentation, so check the release notes for your install method before you plan a rollout. If you’re already thinking about your next Ubuntu move, our look at the Ubuntu 26.10 release features is a good place to start. And while you’re in maintenance mode, our Linux kernel TCP flaw patch guide covers a fix that matters more than this one.

Frequently Asked Questions

Why did my playbooks work on Ubuntu 24.04 but fail on 26.04?

The newer release uses sudo-rs, which formats its password prompt differently. Geerling only ran into the failure after moving servers from Ubuntu 22 and 24 to 26.

Does passwordless sudo avoid the timeout?

According to Geerling, the failure happens only when sudo requires a password. We’d still fix the cause rather than loosen your sudo rules to dodge it.

Which Ansible version should I install?

Ansible Core 2.22.0 or newer has the fix. Backports are reportedly landing in 2.16, 2.18, 2.19 and 2.20, so watch those release notes if you’re pinned to an older line.

Does this mean sudo-rs is broken?

Not from what these reports show. The issue is a prompt mismatch with Ansible’s detection, not a security finding.

Our take

Upgrade your control machine first, since it fixes the cause without touching a single server. Keep the ansible_become_exe=sudo.ws line as a temporary patch for hosts you can’t reach quickly, and skip the system-wide alternative unless you’re sure you want the whole box off sudo-rs. Geerling grumbles that core tools like sudo should change more slowly, and plenty of admins will sympathize, but this one is a small, well-understood break with a clean fix.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *