Typing a password to login is repetitive enough, isn’t it? Entering the password for Sudo on the command-line can be downright irritating. If you don’t need that extra bit of protection, why enter your password more than you have to?[1] You can forever skip entering your sudo password, and it’s super easy and cross-platform. For whatever reason, I learned and forgot about doing this sometime ago, so here’s the gist.

To disable password authentication for sudo for a user, in this case jordan, just run the following command.[2]

$ echo "$USER  ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/$USER

This just adds the line shown in [/etc/sudoers.d/jordan], which allows the given user to run any command with sudo without having to enter a password.

/etc/sudoers.d/jordan
jordan  ALL=(ALL) NOPASSWD:ALL