[Bug 400201] Re: sudo password ask for later in a script

Steve Langasek steve.langasek at canonical.com
Mon Apr 16 00:11:02 UTC 2012


>From the sudo(8) manpage:

       By running sudo with the -v option, a user can update
       the cached credentials without running a command.


** Changed in: sudo (Ubuntu)
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to sudo in Ubuntu.
https://bugs.launchpad.net/bugs/400201

Title:
  sudo password ask for later in a script

Status in “sudo” package in Ubuntu:
  Invalid

Bug description:
  Binary package hint: sudo

  Hi, first of all sorry if I'm not in the right place to post.

  When running personnal scripts, sometimes it is useful to run a sudo
  command once in a while. The problem is, if you're not in front of the
  terminal when running, it asks for the sudo password until you come
  back.... Not convenient if you run a very long script.

  Running the whole script as sudo is not really wise, don't you think ?

  I think it could be useful to have a command that asks for the sudo
  password at the very beginnig and memorize it for later on. Example :

  get_sudo myscript.sh (<-- asks for the password before running the
  script, once for all)

  myscript.sh :
  #!/bin/sh
  normal command (<-- is not run as super user, but casual one)
  another normal command (same)
  ...
  restitute_sudo mkdir ...... (<-- no problem to be run since the password sudo has been remembered)
  ...

  
  What do you think ?

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/sudo/+bug/400201/+subscriptions




More information about the foundations-bugs mailing list