Linux Blog

Adjust sudo timeout

Filed under: Quick Linux Tutorials — TheLinuxBlog.com at 1:05 pm on Thursday, March 5, 2009

SudoI think its pretty evident that I love sudo right? Well, what I do not like about sudo is the timeout. I understand while its there but five minutes is not exactly what I’d call an overly generous time, especially when I’m parked here at my desk for hours upon end. This tutorial shows you the line you’ll need adjust the sudo timeout:

First as root you’ll want to get into the sudo file and edit it. I’m sure you know how to do this since you’ve probably already visudo’ed your way into using sudo and are now trying to adjust the timeout. For those just reading for the sake of it, you’ll do the command: visudo

Right, now you’re there, you’ll either be in nano, pico or vi depending on your distribution. Search for the Defaults section, and put

Defaults:[your username] timestamp_timeout=[your timeout]

Replace your username with yours. Change your timeout to the number of minutes, or -1 for unlimited per session. Save and quit, then exit. Try it again, then try it again after the sudo timeout you set has changed. If it works, great news if not double check your sudoers file for another Default property that may be acting up.

Man Pages for commands in this post »

sudoers

2 Comments »

Comment by tepisi

January 16, 2011 @ 12:56 pm

Is timeout in seconds or minutes?

Comment by Abel

April 12, 2012 @ 9:34 am

From man page 5 for sudoers:


timestamp_timeout

Number of minutes that can elapse before sudo will ask for a passwd again.

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>