Sudo Timeout

Sudo Timeout

Sudo Timeout by default remembers your password is 15 minutes. You can change the default time to whatever you want or even allow it to never expire.

Here I will show you how to set it to an expire time of 60 minutes.

Type the following:

sudo visudo or sudo vi /etc/sudoers

You will see a screen similar to this.

ubuntu server help sudo timeout 1

Now change “Defaults env_rest” to “Defaults env_reset,timestamp_timeout=60” so it looks like the following screenshot

ubuntu server help sudo timeout 2

Now save the file

:wq!

That’s all you are now done!

If you wanted Sudo Timeout to never expire you would of set the “60” to any negative number so something like “-1” or “-5” would work.

 

Extra

  • Check out the the man page for sudoers by typing “man sudoers”
  • Detailed information from Ubuntu on “RootSudo” found here

Leave a Reply

Your email address will not be published. Required fields are marked *