How to change the number of minutes that the sudo password is cached
Written by @mikho, 4 May 2021
Article was migrated from WordPress to Vanilla in March 2022
This is a really QUICK TIP!
When you run any command as root, using sudo, the password is remembered for 15 minutes by default.
If you want to change the time that the password is cached, open the terminal (as root) and run:
editor /etc/sudoers
Find this line in the file:
defaults env_reset
And change it into:
defaults env_reset , timestamp_timeout=x
where “x” is the time in minutes that the password will be cached.
Save and exit and work is done!
Tagged:
Comments
Isn't it generally recommended to use
visudo
to edit the sudoers file?Website: thomassen.sh
Discord: Decicus#0001
Probably not a bad idea for newish Linux users as it checks for syntax issues before making the change.
@mikho - possible amendment to the blog post to make it noob-friendly, if you agree with the above.
Head Janitor @ LES • About • Rules • Support • Donate
There is a visudo post coming up shortly.
Which shows the recommended way to edit the sudoers file.
I will add the link to the new post and more text to explain that it IS possible to do it this way, but there are also other ways.
https://clients.mrvm.net