Skip to content

ubuntu: Add NOPASSWD sudoers rule for 25.10 and 26.04 - #1813

Open
NewtonChutney wants to merge 1 commit into
containers:mainfrom
NewtonChutney:main
Open

NewtonChutney wants to merge 1 commit into
containers:mainfrom
NewtonChutney:main

Conversation

@NewtonChutney

@NewtonChutney NewtonChutney commented Jul 2, 2026

Copy link
Copy Markdown

Ubuntu 25.10 switched from traditional C sudo to sudo-rs (Rust-based sudo). Unlike C sudo, sudo-rs does not use PAM for authentication and therefore does not honor the nullok option in /etc/pam.d/common-auth.
Edit: this analysis is wrong, check comment by foriequal0 below.

Toolbox creates users with an empty password (useradd --password "") and relies on PAM's nullok to accept blank authentication. With sudo-rs, this no longer works and the user gets prompted for a password.

Fix this by adding an explicit NOPASSWD sudoers drop-in for the sudo group, matching the approach already used in the Arch Containerfile. This works regardless of the sudo implementation.

Assisted by: Claude Opus 4.6 noreply@anthropic.com

Fixes #1807

@NewtonChutney
NewtonChutney requested a review from Jmennius as a code owner July 2, 2026 08:05

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request configures passwordless sudo for the sudo group in Ubuntu 25.10 and 26.04 Containerfiles. The reviewer noted that files created in /etc/sudoers.d/ require strict permissions (such as 0440) to be recognized by sudo, and recommended explicitly setting these permissions to prevent the configuration from being ignored.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread images/ubuntu/25.10/Containerfile Outdated
Comment thread images/ubuntu/26.04/Containerfile Outdated

@debarshiray debarshiray left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this, @NewtonChutney ! I didn't have the time to test this, but the changes and what you have written about them look sane to me. Maybe @Jmennius (our Ubuntu maintainer) will get to testing them before me.

Could you please correct your Git authorship information with your full name and a real email address? For what it's worth, projects as diverse as GCC, GnuPG, Linux, Moby and Podman don't allow anonymous or pseudonymous contributions.

@peer-cat

Copy link
Copy Markdown

I ran into this bug today also :)

@foriequal0

Copy link
Copy Markdown

I think some PR descriptions are incorrect.

sudo-rs does not use PAM for authentication

Directly contradicts the README of sudo-rs:

Sudo-rs always uses PAM for authentication
https://github.com/trifectatechfoundation/sudo-rs/blob/86b4f09c9af23413beb643aff515f2ef1901fdb7/README.md?plain=1#L284-L285

It's either sudo-rs's intended policy or just their bug. I created an issue in their repo: trifectatechfoundation/sudo-rs#1656

I, personally, prefer temporarily rolling back to the original sudo until the bug is fixed from sudo-rs

update-alternatives --set sudo /usr/bin/sudo.ws

@NewtonChutney

Copy link
Copy Markdown
Author

Thanks @foriequal0. I'm not aware enough of sudo internals and this analysis was by Claude.. Maybe I should caveat it more clearly..
I had only tested that this PR fixed the issue on both images, and assumed Clsude's analysis was correct.. 🫠

@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed.
https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/local/buildset/51b2fb8b41754f6cb850579e715b62ee

✔️ unit-test SUCCESS in 2m 28s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 14s
✔️ unit-test-restricted SUCCESS in 2m 26s
✔️ system-test-fedora-rawhide-commands-options SUCCESS in 47m 42s
✔️ system-test-fedora-rawhide-runtime-environment-arch-fedora SUCCESS in 36m 25s
✔️ system-test-fedora-rawhide-runtime-environment-ubuntu SUCCESS in 8m 22s
✔️ system-test-fedora-44-commands-options SUCCESS in 37m 39s
✔️ system-test-fedora-44-runtime-environment-arch-fedora SUCCESS in 28m 38s
✔️ system-test-fedora-44-runtime-environment-ubuntu SUCCESS in 8m 06s
✔️ system-test-fedora-43-commands-options SUCCESS in 42m 32s
✔️ system-test-fedora-43-runtime-environment-arch-fedora SUCCESS in 32m 29s
✔️ system-test-fedora-43-runtime-environment-ubuntu SUCCESS in 7m 36s
✔️ system-test-fedora-42-commands-options SUCCESS in 36m 50s
✔️ system-test-fedora-42-runtime-environment-arch-fedora SUCCESS in 28m 25s
✔️ system-test-fedora-42-runtime-environment-ubuntu SUCCESS in 7m 07s
system-test-fedora-coreos-next-commands-options NODE_FAILURE Node(set) request 200-0000179715 failed in 0s
system-test-fedora-coreos-next-runtime-environment-arch-fedora NODE_FAILURE Node(set) request 200-0000179716 failed in 0s
system-test-fedora-coreos-next-runtime-environment-ubuntu NODE_FAILURE Node(set) request 200-0000179717 failed in 0s
✔️ system-test-fedora-coreos-stable-commands-options SUCCESS in 37m 56s
✔️ system-test-fedora-coreos-stable-runtime-environment-arch-fedora SUCCESS in 29m 56s
✔️ system-test-fedora-coreos-stable-runtime-environment-ubuntu SUCCESS in 9m 34s
system-test-fedora-coreos-testing-commands-options NODE_FAILURE Node(set) request 200-0000179721 failed in 0s
system-test-fedora-coreos-testing-runtime-environment-arch-fedora NODE_FAILURE Node(set) request 200-0000179722 failed in 0s
system-test-fedora-coreos-testing-runtime-environment-ubuntu NODE_FAILURE Node(set) request 200-0000179723 failed in 0s

@NewtonChutney

Copy link
Copy Markdown
Author

@Jmennius would you like to proceed with NOPASSWD or with a switch to the old sudo impl as suggested by @foriequal0:

I, personally, prefer temporarily rolling back to the original sudo until the bug is fixed from sudo-rs

Ubuntu 25.10 switched from traditional C sudo to sudo-rs (Rust-based
sudo). Unlike C sudo, sudo-rs does not use PAM for authentication and
therefore does not honor the nullok option in /etc/pam.d/common-auth.

Toolbox creates users with an empty password (useradd --password "")
and relies on PAM's nullok to accept blank authentication. With sudo-rs,
this no longer works and the user gets prompted for a password.

Fix this by adding an explicit NOPASSWD sudoers drop-in for the sudo
group, matching the approach already used in the Arch Containerfile.
This works regardless of the sudo implementation.

Assisted by: Claude Opus 4.6 <noreply@anthropic.com>
@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed.
https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/local/buildset/64c9e0dc433d48b99674c6d9110211d7

✔️ unit-test SUCCESS in 2m 22s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 22s
✔️ unit-test-restricted SUCCESS in 2m 11s
✔️ system-test-fedora-rawhide-commands-options SUCCESS in 39m 35s
✔️ system-test-fedora-rawhide-runtime-environment-arch-fedora SUCCESS in 27m 44s
✔️ system-test-fedora-rawhide-runtime-environment-ubuntu SUCCESS in 7m 41s
✔️ system-test-fedora-44-commands-options SUCCESS in 40m 48s
✔️ system-test-fedora-44-runtime-environment-arch-fedora SUCCESS in 30m 56s
✔️ system-test-fedora-44-runtime-environment-ubuntu SUCCESS in 7m 56s
✔️ system-test-fedora-43-commands-options SUCCESS in 38m 45s
✔️ system-test-fedora-43-runtime-environment-arch-fedora SUCCESS in 30m 16s
✔️ system-test-fedora-43-runtime-environment-ubuntu SUCCESS in 7m 47s
✔️ system-test-fedora-42-commands-options SUCCESS in 34m 40s
✔️ system-test-fedora-42-runtime-environment-arch-fedora SUCCESS in 26m 15s
✔️ system-test-fedora-42-runtime-environment-ubuntu SUCCESS in 7m 21s
system-test-fedora-coreos-next-commands-options RETRY_LIMIT in 26s
system-test-fedora-coreos-next-runtime-environment-arch-fedora RETRY_LIMIT in 26s
system-test-fedora-coreos-next-runtime-environment-ubuntu RETRY_LIMIT in 26s
✔️ system-test-fedora-coreos-stable-commands-options SUCCESS in 41m 16s
✔️ system-test-fedora-coreos-stable-runtime-environment-arch-fedora SUCCESS in 32m 50s
✔️ system-test-fedora-coreos-stable-runtime-environment-ubuntu SUCCESS in 9m 17s
✔️ system-test-fedora-coreos-testing-commands-options SUCCESS in 42m 21s
✔️ system-test-fedora-coreos-testing-runtime-environment-arch-fedora SUCCESS in 34m 03s
✔️ system-test-fedora-coreos-testing-runtime-environment-ubuntu SUCCESS in 9m 43s

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

F44 host + Ubuntu 26.04 client, sudo does not work due to missing NOPASSWD: in sudoers

4 participants