LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Possible to Query for Root Password with Shortcuts? (https://www.linuxquestions.org/questions/linux-security-4/possible-to-query-for-root-password-with-shortcuts-425757/)

Wheat_Thins 03-17-2006 10:29 AM

Possible to Query for Root Password with Shortcuts?
 
Does anybody know if it is possible to be queried when trying to open up programs that require root permissions to run correctly when trying to launch them from a shortcut on the launcher panel? I was just curious because it has this feature built in for all the administrative things on the menu like configuring network ETC. (Where it asks you for the root password before it launches) Is there any way to pass parameters through a custom launcher that could also do the same thing so I can actually launch programs from the launch panel as opposed to opening a terminal SU'ing and launching it?

Thank in Advance!

DrEwMoNeY 03-17-2006 12:55 PM

Do you mean to lock people out from using certain applications? Requiring the root password to use, say, Firefox, or some other application, that doesn't normally request the root password?

Wheat_Thins 03-17-2006 04:16 PM

Quote:

Originally Posted by DrEwMoNeY
Do you mean to lock people out from using certain applications? Requiring the root password to use, say, Firefox, or some other application, that doesn't normally request the root password?

Not so much, I have some network tools like a nmap front end that require root access to be fully functional, but I like to launch the nmap front end from a launcher shortcut off the launcher panel on the top of the screen. Is there anyway to have it come up with a dialog box that asks for root access instead, this way I don't have to open a terminal, do a SU, then type the command to launch the GUI. I am really just looking for a way to make it ask me for the root password so I have fully functionality out of the programs that need root access, all while just being able to launch it off the launcher bar:confused:

DrEwMoNeY 03-17-2006 04:21 PM

I'm not sure if this is true in your case, but if I add a program to the kicker, and it needs a root password, that box will pop up automatically.

Just try adding it to your kicker or desktop and then click on it and see if it asks for your password.

PTrenholme 03-17-2006 07:53 PM

There is the kdesu command (for use with KDE) that prompts to the root password, and then runs the rest of the line as root. Is this the sort of thing you need? (GNOME has a similar command and, I believe, can also run the kdesu command.

mrclisdue 03-17-2006 10:38 PM

kdesu -c <command> works, and gives you the 'nicer' dialog.

su -c <command> also works, and a terminal window pops up (and stays up as long as the command is open) prompting for pw.

there are older strictly gnome variations around:

gnomesu.sf.net

and you might be able to find a dusty gsu (officially 'unreleased' and as valuable as a beatles' basement tape (or not)) around.

or even gksu

but i can't vouch for their veracity.......

EDIT: i've been thinking (careful....), and i tested this myself: if the process you're attempting to create a launcher for can only be run as root, eg. system-config-packages - you can create a launcher using that as the command, and it will prompt you for a pw when you launch it.
however, if the process you wish to launch can be run by both user and root (albeit with different results, eg launching a mail client to retrieve local mail), then you'll have to go with the su routines.

cheers,

Wheat_Thins 03-18-2006 09:18 AM

Thanks a million guys, adding kdesu -c '*command here*' under the launchers command line works great!

THANK YOU!:D:D:D:D


All times are GMT -5. The time now is 07:54 AM.