How to modify the default timeout time of sudo in Ubuntu system?

  
                

For system security issues, Ubuntu systems generally disable the root account by default during installation, replacing all administrator-required operations with the sudo command. In Ubuntu, the default sudo timeout time is 5 minutes, but some users think that the five minutes is too short, and it is cumbersome to enter the password each time. So, how to modify the default timeout time of sudo in Ubuntu system?

follows:

sudo visudo

Find the following line

defaults env_reset

change this behavior follows

Defaults env_reset , timestamp_timeout=x

x is the time, you can set it to 10 or 30, which means 10 minutes or half an hour.

It can also be set to -1 so that you remember your password before you log out or exit terminal. When doing this, sometimes for security reasons, you can also force the exit sudo by running the following command.

sudo -K

The above is the way to modify the default timeout time of sudo in Ubuntu system. If your timeout time is not long enough, then try the above method to modify the default time.

Copyright © Windows knowledge All Rights Reserved