Search tutorial by keyword

How to Change How Long sudo Waits Before it Prompts You Again

If you are Linux administrator sudo command comes in your every minute job and you may have noticed that if you run another command using sudo shortly after the first command, you are not prompted for your password again.

You can customize the length of that grace period in which you are not asked to enter your password for the sudo command again by changing a setting for the sudo command.

We will open the “/etc/sudoers” file and change a setting to customize the length of the grace period. To begin, press Ctrl + Alt + T to open a Terminal window. Type the following command at the prompt and press Enter.

#sudo visudo

Type the password and press Enter

Search for the following line: 

Defaults         env_reset

Change the line by adding “, timestamp_timeout=x” to the end of the line.

This line will become like this 

Defaults                 env_reset, timestamp_timeout=x

Here “x” shows the amount of time of grace period or the time you want to wait

x is in minutes

 

Last modified onMonday, 04 May 2015 14:35
Michael Dudli

Cloud Specialist with more than 10 years experience in the Hosting Business.

Website: www.cloudserver24.com

Contact

Sales

sales@cloudserver24.com

Support

support@cloudserver24.com