need to gnome to popup window to ask for password

hello,
I have an application that I’d like to run as root. I already know how to do this when I’m in the console.

What I’d like to do is to create an application launcher and configured it to invoke the application. This would make things more convenient.

When I click on the application launcher icon however, the application is invoked but is running as my current user account.

Is there a way to configure Gnome (or something else) so that when I click on the application launcher for that application, it would automatically run as root and hence cause a popup window to ask for the root password before continuing.

I get the feeling that ‘chmod’ might be something I’d need to use to solve this problem.

Any help is appreciated. Thanks in advance.

Yes you can do that easily. Just add “gksudo” before the launcher’s command.

For example, if you want to open Nautilus as root, set the launcher’s command as “gksudo nautilus” without quotes.

Now when you click the launcher a pop-up window appears and asks for root password. :slight_smile:

buzlite wrote:

>
> hello,
> I have an application that I’d like to run as root. I already know how
> to do this when I’m in the console.
>
> What I’d like to do is to create an application launcher and configured
> it to invoke the application. This would make things more convenient.
>
> When I click on the application launcher icon however, the application
> is invoked but is running as my current user account.
>
> Is there a way to configure Gnome (or something else) so that when I
> click on the application launcher for that application, it would
> automatically run as root and hence cause a popup window to ask for the
> root password before continuing.
>
> I get the feeling that ‘chmod’ might be something I’d need to use to
> solve this problem.
>
> Any help is appreciated. Thanks in advance.

Q1) Are you sure you really want to do this?
Q2) Is this an application you have written yourself?
Q3) Do you plan to distribute this application to anyone else?

A1) You might want to consider the SECURITY implications. Why does this
application require root privileges?
A2) The security concerns are even MORE significant if you did not write
this application yourself. Do you have 100% trust in the source from which
you obtained this application?
A3) Do you seriously think an experienced Linux user would fill in his root
password at such a prompt without first answering these questions himself?

These are good points you raised.
I am trying to run a program called wireshark that came with the openSuse 11 distribution DVD. This programs seems to only run properly when it is run as root.
I agree that your points still stand valid as it applies to any application even if it came from the distribution DVD.

I followed you suggestion but it didnt work. In the application launcher applet, I used “gksudo /usr/bin/wireshark” as the command. When I invoked it, it get a message box saying:

Could not launch application
Failed to execute child process “gksudo” (No such file or directory)

Is gksudo a separate program that I need to install? This program is not in my system nor could I find it on the distribution DVD.
Thanks

buzlite wrote:

> These are good points you raised.
> I am trying to run a program called wireshark that came with the
> openSuse 11 distribution DVD. This programs seems to only run properly
> when it is run as root.
> I agree that your points still stand valid as it applies to any
> application even if it came from the distribution DVD.

When you said, “I have an application that I’d like to run as root,” I did
not interpret it as a “standard” (as in “trustworthy”) application.

The only question I have now is why you need to do anything. When I run
wireshark (in OSS 11.0 KDE 3.5), I get exactly what you seem to want. It
first prompts me for the root password. After providing that, it opens the
main window. It even pops up a small window stating:
Running as user “root” and group “root”.
This could be dangerous.
Does it not do this for you?

I found out what I did wrong with the program in question. I forgot that all I needed to do was to drag the wireshark icon from Application Browser to the panel.
What I did was I manually created an Custom Application Launcher for that program.

Still, I’d be interested in how it could be done.

buzlite wrote:

> I found out what I did wrong with the program in question. I forgot that
> all I needed to do was to drag the wireshark icon from Application
> Browser to the panel.
> What I did was I manually created an Custom Application Launcher for
> that program.
>
> Still, I’d be interested in how it could be done.

You might try asking in the “programming-scripting” forum.