Automation jobs and tightly controlled administration accounts can stall when sudo waits for an interactive password. A passwordless sudo rule lets a trusted Linux account run privileged commands without that prompt, so the account must be treated as a direct path to root access.
The sudo policy engine reads /etc/sudoers and included drop-ins under /etc/sudoers.d. A rule tagged with NOPASSWD changes the authentication requirement for the matching user or group, while visudo guards the policy syntax before the file is saved.
Use a dedicated drop-in instead of editing the main file directly, keep the filename free of dots or backup suffixes, and validate the full policy after saving. Grant NOPASSWD: ALL only to accounts that already have that level of trust, or replace ALL with the exact commands the account needs.
$ id sgnopass uid=1001(sgnopass) gid=1001(sgnopass) groups=1001(sgnopass),27(sudo)
Use getent group buildadmins instead when the rule should target an existing group instead of one user.
$ sudo visudo -f /etc/sudoers.d/90-sgnopass-nopasswd
Use a simple filename without dots because sudo skips filenames containing . inside /etc/sudoers.d.
/etc/sudoers.d/90-sgnopass-nopasswd sgnopass ALL=(ALL:ALL) NOPASSWD: ALL
Replace sgnopass with the real account name, or use %buildadmins ALL=(ALL:ALL) NOPASSWD: ALL to grant the same behavior to every member of a group.
$ sudo visudo -c /etc/sudoers: parsed OK
Use the full check instead of validating only the new file so visudo can catch policy-wide syntax, ownership, and permission problems.
$ sudo -l -U sgnopass
User sgnopass may run the following commands on host:
(ALL : ALL) ALL
(ALL : ALL) NOPASSWD: ALL
The NOPASSWD: ALL entry confirms that the rule is active for the account.
$ sudo -iu sgnopass sudo -k
This forces the next privileged command to rely on the saved NOPASSWD rule instead of a previously cached password check.
$ sudo -iu sgnopass sudo -n whoami root
Passwordless sudo means any process running as that account can request root privileges immediately, so reserve it for tightly controlled accounts or narrow the rule to specific commands instead of ALL.