To allow a user (e.g., <username>) to execute sudo commands without being prompted for a password:

  1. Create a sudoers override file:
    echo "<username> ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/<username>
    
  2. Set the correct permissions:
    sudo chmod 0440 /etc/sudoers.d/<username>
    
  3. Verify the configuration:
    sudo systemctl status
    

Updated: