On a freshly installed Ubuntu 22.04 server you create a user called alex and add the account to the sudo group with:
sudo usermod -aG sudo alex
After logging out and back in, alex can run sudo apt update even though neither /etc/sudoers nor any file in /etc/sudoers.d has been edited. Which explanation correctly describes why this procedure works?
When a session is started by a sudo group member, PAM grants the CAP_SYS_ADMIN capability to all of the user's processes, eliminating the need for sudo.
A built-in polkit rule maps the sudo group to the wheel role, providing password-less root access only from the system console.
Members of the sudo group are automatically assigned UID 0 in /etc/passwd, giving them root privileges without needing sudo or a password.
The default /etc/sudoers file contains the entry %sudo ALL=(ALL:ALL) ALL, so any user added to the sudo group may execute any command with sudo after entering their own password.
Ubuntu's default /etc/sudoers file already contains a line that delegates full sudo privileges to members of the sudo group:
%sudo ALL=(ALL:ALL) ALL
Because this rule is present out-of-the-box, adding a user to the sudo group is enough to let them run any command via sudo. The rule still requires the user to authenticate with their own password, so the privilege is not password-less.
The other statements are inaccurate:
The sudo group is not mapped to UID 0 and does not bypass the password prompt.
PAM does not automatically grant system-wide capabilities such as CAP_SYS_ADMIN just because a user is in a particular group.
polkit rules are unrelated to classic sudo group elevation on headless or server installations and do not remap the group to a wheel role.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does '%sudo ALL=(ALL:ALL) ALL' in /etc/sudoers mean?
Open an interactive chat with Bash
What happens when a user is added to the sudo group on Ubuntu?
Open an interactive chat with Bash
How does authentication work with sudo commands in this setup?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Security
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access