Results 1 to 5 of 5

Thread: [SOLVED] SUDO password timeout

  1. #1
    Join Date
    Mar 2006
    Location
    Hershey, PA
    Beans
    Hidden!
    Distro
    Ubuntu 11.04 Natty Narwhal

    Question [SOLVED] SUDO password timeout

    Is there a way to increase the timeout period for the sudo password. I find I am trying to do some things in Ubuntu and I enter the sudo password and several minutes later I have to answer it again.
    CyberPower Gamer Ultra 7209 | AMD Athlon II X2 240 | 6 GB RAM | 1000GB & 500GB SATA-II HD
    ATI Radeon HD4550 | HP 2430 Printer | Ubuntu 11.04 | Windows 7 | ViewSonic VA703b Monitor

  2. #2
    Join Date
    Mar 2008
    Location
    City of Pines
    Beans
    3,585

    Re: SUDO password timeout

    Quote Originally Posted by alienexplorers View Post
    Is there a way to increase the timeout period for the sudo password. I find I am trying to do some things in Ubuntu and I enter the sudo password and several minutes later I have to answer it again.
    On your terminal:

    Code:
    sudo visudo
    then look for the "Defaults" text inside the configuration file, if you can't find one, insert the line of texts below to you end part of your sudoers file.

    Defaults passwd_timeout=10
    Giving it a 10 minutes delay.

    Save file.

    PS: If "Defaults" exist, just add passwd_timeout=10 separated by a comma from the latter.

    i.e:

    Defaults syslog=auth,passwd_timeout=10
    Steady movement is more important than speed, much of the time. So long as there is a regular progression of Stimuli to get your mental hooks into, there is room for lateral movement. Once this begins, its rate is a matter of discretion.

  3. #3
    Join Date
    Sep 2006
    Location
    France.
    Beans
    Hidden!
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: SUDO password timeout

    Quote Originally Posted by alienexplorers View Post
    Is there a way to increase the timeout period for the sudo password. I find I am trying to do some things in Ubuntu and I enter the sudo password and several minutes later I have to answer it again.
    Either you get a root shell which is not officially recommended or you tweak the sudoers file and change the passwd_timeout variable.

    Code:
    passwd_timeout
        Number of minutes before the sudo password prompt times out. The default is 5, set this to 0 for no password timeout.
    More.
    | My old and mostly abandoned blog |
    Linux user #413984 ; Ubuntu user #178
    J'aime les fraises.
    Nighty night me lovelies!

    | Reinstalling Ubuntu ? Please check this bug first ! |
    | Using a ppa ? Please install ppa-purge from universe, you may need it should you want to revert packages back |
    | No support requests / username changes by PM, thanks. |
    [SIGPIC][/SIGPIC]

  4. #4
    Join Date
    Feb 2008
    Location
    In a bucket, in Dublin
    Beans
    458
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: SUDO password timeout

    I think this is the right place to post this problem. I set up a few tasks the other night - something as follows:
    Code:
    sudo apt-get update   &&   sudo apt-get upgrade   &&   sudo apt-get install "several packages"   &&   sudo apt-get autoclean   &&   sudo poweroff
    I wanted them to all complete through the night while I was resting my weary eyes but the only problem is the "sudo apt-get upgrade" or possibly the "sudo apt-get install XXXXX" we're going to take longer than the 10 minutes allowed for sudo privileges that by the time the job got to "autoclean" or "poweroff" I would need to enter the password again, that could very well have been 3AM, and for that reason the machine may not have shutdown (I'd prefer if it would as it's a hot running laptop). How can I get around this without doing a:
    Code:
    sudo su
    Or is that the only way around this.

  5. #5
    Join Date
    Aug 2007
    Location
    Karma BC
    Beans
    1,215
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: [SOLVED] SUDO password timeout

    in terminal
    sudo nano /etc/sudoers
    use the arrow keys to navigate to the line that says:
    #%sudo ALL=NOPASSWD: ALL
    and remove the hash-mark/pound(number sign) at the beginning of the line.

    type Cntrl+x (that's the control button and x at the same time), answer y then enter. Now you'll only need to enter sudo at the start of your session.
    Kipling - "if"

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
  •