Shortening default sudo timeout

dinosb
  11 years ago
  4

Using sudo is safer than using a root account, but it's timeout can be pretty long (especially on *buntoids). 

To shorten it, open Terminal and type:

sudo visudo

When the text file opens in Terminal, find the line that says

Defaults env_reset

and add the following line

timestamp_timeout=0 

(where 0 is the number of minutes) so it looks like this: 

Defaults env_reset , timestamp_timeout=0 

Save the changes and exit. After it's done, sudo will timeout right away for all future sessions. 

Note: If the timeout is set for less than 0, the session never expires.

Tip: For ending current sudo session, type in "sudo -k".

Comments
jahid_0903014 10 years ago

good information....