Symptoms & scope
- sudo reports that the user or command is not authorized.
- A newly added admin group has no effect in an existing session.
Relevant environment
sudo with sudoers policy; listing rules may request authentication but does not execute the proposed privileged command.
Recognizable messages (synthetic examples)
sudo: example : user NOT in sudoers ; TTY=pts/2 ; PWD=/home/example ; USER=root ; COMMAND=/usr/bin/idCheck policy and group membership; changing the user password does not supply a missing authorization.
sudo: example : command not allowed ; TTY=pts/2 ; USER=root ; COMMAND=/usr/bin/systemctl restart example.serviceInspect command path, arguments and RunAs target rather than widening all account privileges.
Possible causes
These are possible explanations, not a confirmed diagnosis. Several independent faults can coexist.
- The current process may not have the account’s new supplementary groups.
- The rule may constrain command paths, arguments, target users or hosts.
Diagnose safely
Run one command at a time in the relevant session. Read the explanation first. Uppercase placeholders need your own values; tools and privileges vary by distribution. These commands are displayed here and never executed by the website.
Check 1
Prints identity and groups of the current shell without querying or changing sudo policy.
idInterpret the result: Compare with the intended authorized group; group membership in an account database does not update already running shells.
Check 2
Lists permitted commands for the current account. It may ask for authentication and write normal audit records; it does not run a listed command.
sudo -lInterpret the result: Read RunAs targets, full paths and argument restrictions. An authentication failure here does not prove a missing sudoers rule.
Evidence-guided next steps
Have an administrator repair the narrow rule
If a required operation is absent, an existing administrator should edit the appropriate sudoers fragment with visudo and specify the required target user, full command path and safe arguments. Validate the complete policy and retain recovery access.
Precautions: Do not grant ALL or NOPASSWD: ALL as a shortcut. User-writable executables and broad argument wildcards can defeat restrictions.
Recovery / rollback: Remove the added rule through visudo or restore the saved fragment, then validate the complete policy again.
Did this solution help you?
References & review
This guide was prepared from primary project or distribution sources and reviewed on the date shown. This is an editorial source check, not evidence that a fix was reproduced on your hardware. Diagnostic log examples are synthetic fixtures. Version-dependent details must be checked against your installed release.
- Sudo manual: list mode, authentication and diagnostics (project or distribution documentation)
- Sudoers manual: command matching and policy diagnostics (project or distribution documentation)