Steps to run a sudo command without a password
-
Open
/etc/sudoers
withvisudo
editor, as if straight away edit/etc/sudoers
file with text editor, it won't validate the syntax. -
Append this line
username ALL=(ALL:ALL) NOPASSWD:ALL
at the end of the/etc/sudoers
file -
Open a new terminal window and test the command with root privileges
Written by
KarChunT
At
Fri Mar 28 2025