How can I double click and open application with sudo permission
I have an application that can be opened in Terminal by entering the following command:
sudo ./MyApplication The Terminal will then prompt me for my sudo password which I will need to enter manually. And the program will run. Is there any ways where I can just double click my application icon and run it directly with sudo permissions? Can I set it in the properties to automatically run it with sudo permissions which is something like setting "Run the program as an Administrator"? |
create a file containing the text:
Code:
sudo MyApplication |
Quote:
Here's one way -- put this into a shell script: Code:
kdesu (program name) Code:
gnomesu (program name) |
Quote:
edit /etc/sudoers and put the following in it: # User privilege specification root ALL=(ALL) ALL yourname ALL=(ALL) NOPASSWD: ALL |
what should I use to edit it with?
|
any text editor ! duh !
|
Quote:
|
Quote:
|
do you know how confusing it is to help 2 people at once?
i am booting Ubuntu (shutter) now to see what you can use |
Quote:
when i type sudo ./MyApplication it still ask me for my password. what I need is to be able to run MyApplication when I double click the icon and run with sudo permission. |
ok type sudo gedit at the terminal
|
ok i have solve my problem by creating a shell script file with the command "gksudo MyApplication" inside. By double clicking this file i can run my application with sudo permissions.. it will have a dialog box prompting me to enter the password at least =)
|
OK, you have to edit the file using "visudo" as root.
type visudo sudoers then make the changes and save. you have to edit with "visudo" It says right in the file how to edit. |
Quote:
|
Quote:
Don't you understand that "sudo" requires the root password, and that when sudo is enabled, you become root? Logging on as root, and using "sudo", both give you root privileges. The latter is preferred. |
All times are GMT -5. The time now is 07:13 PM. |