Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

1 Answer 1

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. –  kuurious May 3 '11 at 8:05

Your Answer

 
discard

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.