DevOpsDevOps

How To Enable Passwordless Sudo For A Specific User in Linux

Oct 01, 2017 · Updated: Jun 24, 2026 · by

This can be done in 3 quick steps:

  1. Open the sudoers file: sudo nano /etc/sudoers
  2. Find the line that contains includedir /etc/sudoers.d
  3. Below that line, add username ALL=(ALL) NOPASSWD: ALL, where username is the user you want to grant passwordless sudo to. Save your changes.

You're done. From now on, that user can run sudo any_command without entering a sudo password.

Hey, if you've found this useful, please share the post to help other folks find it:

There's even more:

Subscribe for updates