How to Disable the sudo Password in Linux Mint 21
Every time you use the sudo command the system will ask for the password before executing the command. If we run the simple update command then it will ask for the password as shown below:
You can configure the sudo to never ask for your password by following the below given steps:
In the terminal type the following command to access the sudoers file:
A file will open, in the bottom of the file look for includedir /etc/sudoers.d and add the below given lines at the end, replace the <username> with your own username on your system:
<username> ALL=(ALL) NOPASSWD:ALL
Save and close the file, after making these changes you can execute the sudo command in the terminal without prompting with a password. Confirm the saved changes by executing the system update command with sudo privileges:
Note: These changes are only for the terminal, you still have to enter the password while installing the tools from the Software Manager.
How to Re-enable the sudo Password in Linux Mint 21
If you ever want to re-enable the sudo password in the terminal you can again edit the sudoers files and remove the lines you have added at the end of the file.
Bottom Line
Enabling and disabling the sudo password in Linux Mint 21 is simple as you just have to make a few changes in the sudoers file. These changes will now stop you from being asked for your password for all the commands running in the terminal.