Inspired by this question….
I am the sole person using my system with 12.04.
Every time I issue a sudo
command; the system asks for the user password (which is good in its own way).
However I was thinking; without activating the root account; how can I execute the sudo commands which will not ask for user password to authenticate.
NOTE: I want to execute sudo command without authenticating via password; only when they are executed via terminal.
I don't want to remove this extra layer of security from other functions such a while using 'Ubuntu software center' or executing a bash script by drag-drop something.sh file to the terminal.
Best Answer
You can configure
sudo
to never ask for your password.Open a Terminal window and type:
In the bottom of the file, add the following line:
Where
$USER
is your username on your system. Save and close the sudoers file (if you haven't changed your default terminal editor (you'll know if you have), press Ctl + x to exitnano
and it'll prompt you to save).As of Ubuntu 19.04, the file should now look something like
After this you can type
sudo <whatever you want>
in a Terminal window without being prompted for the password.This only applies, to using the
sudo
command in the terminal. You'll still be prompted for your password if you (for example) try to install a package from the software center