Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to execute a command with administrative privileges, but do not have an access to the tty.

I tried to execute it with the -A option of the sudo command and setting the environment variable SUDO_ASKPASS=/usr/bin/gksu.

To do the same I ran the command as following

env SUDO_ASKPASS=/usr/bin/gksu sudo -A _root-privilage-cmd_ 

But I got the gksu window, which would not authenticate me...

share|improve this question

If you want to get the password prompt, why not simply run gksu command?

Otherwise, to avoid the password prompt, you need to tweak into /etc/sudoers file, to say that that command can be executed without a password (but also without a password you need to run it through gsku).

share|improve this answer
I want to run the root-previlage-cmd from an application launched by normal user, but in the application I would like to run the root-previlage-cmd which should get me the password prompt to authenticate the admin-previlages. – Cuurious May 3 '11 at 8:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.