3

I'm frequently using application launchers to run personal bash scripts and thus I often use gksudo in case I do administrative tasks. The problem is that when I execute a command with gksudo,the execution is successful, but afterwards gksudo waits for about 5 seconds before it closes/finishes. In some scripts I use gksudo multiple times, resulting in execution times of a few minutes, even though everything should be done in a few seconds.

Can anyone help me here?

PS: here are my main /etc/sudoers-settings (might have something to do with my problem):

Defaults    env_reset,!tty_tickets,timestamp_timeout=2
phoenix ALL= NOPASSWD: /bin/mount,/bin/umount,/usr/sbin/firestarter,/usr/bin/truecrypt,/usr/bin/apt-get
phoenix
  • 31
  • Why are you using gksudo over sudo, or are these GUI applications? – david6 Nov 30 '11 at 08:35
  • OP are you still looking for an answer? – Ringtail Feb 25 '12 at 22:23
  • This question appears to be abandoned, if you are experiencing a similar issue please ask a new question with details pertaining to your problem. If you feel this question is not abandoned, please flag the question explaining that. :) – Ringtail Feb 26 '12 at 05:34
  • The wait here was likely caused by the setting to no tty_tickets (!tty_tickets). In sudo 1.7.4+ that can cause some unwanted affects, in the above case really nothing to be gained anyway, the timeout only applies per instance – doug Mar 01 '12 at 00:17

1 Answers1

1

By default, the Root account password is locked in Ubuntu. This means that you cannot login as Root directly or use the su command to become the Root user. However, since the Root account physically exists it is still possible to run programs with root-level privileges. This is where sudo comes in - it allows authorised users (normally "Administrative" users; for further information please refer to AddUsersHowto) to run certain programs as Root without having to know the root password.

This means that in the terminal you should use sudo for commands that require root privileges; simply prepend sudo to all the commands you would normally run as Root.

Basically boils down to this:

Use gksudo=GUI applications

Use sudo=CLI applications

Bruno Pereira
  • 73,643
Ringtail
  • 16,127