sudo without password

To set sudo without asking for a password:

<username> = your user name

Run as root:

visudo -f /etc/sudoers.d/<username>

Write:

<username> ALL=(ALL) NOPASSWD: ALL

Save & restart console.

One command:

echo "$USER ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/$USER
Tags: sudo, su, password, ubuntu, configuration

« Docker Engine and Docker Compose on Ubuntu 16.04 - Take all registered jQuery Event Handlers »