How to change the password remember time of sudo

change password remember time linux

When you run any command as root, the password is remembered for 15 minutes by default. If you want to change the password remember time, just open the terminal and run:
 sudo visudo  

The sudoers file will be opened in the terminal (the text editor will be nano in Ubuntu and vi in Arch Linux). Search for the following line:
 defaults   env_reset  

Just change this line into:
 defaults   env_reset , timestamp_timeout=x  

where "x" is the password remembering time in minutes.

In case you dont want to use nano or vi, to open the sudoers file with your favorite text editor, for example gedit, you can use this command:
 sudo EDITOR=gedit visudo  
linux tips and tricks