Results 1 to 9 of 9

Thread: [SOLVED] Howto: change default timeout (from 5 minutes) in sudo

  1. #1
    arnieboy Guest

    [SOLVED] Howto: change default timeout (from 5 minutes) in sudo

    Some of you might not like the default timeout of 5 minutes after which sudo asks for your password again in a session. To change that do the following:
    Code:
    sudo visudo
    scroll down and add the following line at the end:
    Defaults:user_name timestamp_timeout=10
    1) Change user_name to your actual user name.
    2) Change 10 (in minutes) to anything you wish. A value of -1 will make it infinite (for a single session).
    3) Hit Ctrl-X and then hit Y.
    You are all set!
    Last edited by arnieboy; May 28th, 2006 at 05:55 AM.

  2. #2
    Join Date
    Jun 2005
    Location
    France
    Beans
    7,100
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Change default timeout (from 5 minutes) in sudo

    Nice guide arnie

    Does it work for dapper too ?

  3. #3
    arnieboy Guest

    Re: HOWTO: Change default timeout (from 5 minutes) in sudo

    Quote Originally Posted by frodon
    Nice guide arnie

    Does it work for dapper too ?
    works for all ubuntu releases frodon.

  4. #4
    Join Date
    Mar 2006
    Location
    Faroe Islands
    Beans
    917

    Re: Howto: change default timeout (from 5 minutes) in sudo

    So if I set it to infinite(-1), is there a manual way to turn superuser off after I use a sudo command?

  5. #5
    arnieboy Guest

    Re: Howto: change default timeout (from 5 minutes) in sudo

    Quote Originally Posted by Sammi
    So if I set it to infinite(-1), is there a manual way to turn superuser off after I use a sudo command?
    superuser is not "ON" when u use sudo. u merely let your user account gain super user permissions.
    if u set it to -1, the sudo password will not timeout till u log out of your account.

  6. #6
    Join Date
    Mar 2006
    Location
    Faroe Islands
    Beans
    917

    Re: Howto: change default timeout (from 5 minutes) in sudo

    I understand that much. Just wasn't clear enough in my previous post. The thing I was wondering is if there is another way of taking superuser priveledges away from the user account, after a sudo command with an infinite timer has been issued, other that logging off ofcourse?

    If not then that option is kind of useless I think. Could just as well just make a root account if I wanted to stay in superuse mode all the time.

  7. #7
    Join Date
    Nov 2005
    Location
    Montreal, Canada
    Beans
    525

    Lightbulb Re: Howto: change default timeout (from 5 minutes) in sudo

    Quote Originally Posted by Sammi
    So if I set it to infinite(-1), is there a manual way to turn superuser off after I use a sudo command?
    If you set sudo's time to infinite (-1) you can kill it at any time with the following
    Code:
    sudo -K
    This works regardless how long you set sudo to last.
    Last edited by BobSongs; June 1st, 2006 at 03:40 AM.

  8. #8
    Join Date
    Mar 2006
    Location
    Faroe Islands
    Beans
    917

    Re: Howto: change default timeout (from 5 minutes) in sudo

    There we go. Thx!

  9. #9
    Join Date
    Aug 2009
    Location
    India
    Beans
    2,110
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: [SOLVED] Howto: change default timeout (from 5 minutes) in sudo

    Short and useful how to

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •