Is there a way through which I can make the sudo
command give me permissions for a longer period than its default time?
It can be a pain having to keep entering the sudo
password, when requiring the installation of many packages, so it would be nice if there exists a command or configuration that can be done to affect it usage period.
Best Answer
Behavior of
sudo
is configured in/etc/sudoers
file. There istimestamp_timeout
option responsible for reprompting the user for password after specific amount of time.From man sudoers
To alter that setting do the following:
sudo visudo
.visudo
is used specifically to edit/etc/sudoers
file and by default usesnano
text editor.Find the lines starting with
Defaults
. Add the following linewhere x is the amount of minutes you want between reprompts
Save the file with Ctrl + O