Dont ask for password when using sudo

sudo visudo

What I normally do here is right at the bottom of the file I will add the following for a single user.

myuser ALL=(ALL) NOPASSWD: ALL

And this for a group

%group ALL=(ALL) NOPASSWD: ALL

Then you need to click Ctrl+O then Ctrl+X (if using nano, otherwise save and exit using the relevant commands)

Now once you log out and back in you won’t be asked for a password when sudo’ing

DISCLAIMER

I only recommend this in a lab environment for convenience, you shouldn’t do this in production for the obvious security concerns and also to protect you from running the wrong command by accident…

Leave a Reply

Your email address will not be published. Required fields are marked *