LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-28-2012, 05:51 PM   #1
cravengemetzel
LQ Newbie
 
Registered: Dec 2012
Location: Ontario, Canada
Distribution: Netrunner Rolling
Posts: 16

Rep: Reputation: Disabled
Is there a command to open a root terminal and execute a function?


I am trying to set up my Openbox menu exactly as I want it to be, but I ran into a problem: some of my pentesting programs require me to be root in order to run, so I can't just add "Eterm -e programname" in the menu.

What I need is something that will cause a gksu (or the like) interface to come up, asking me to authorize myself as root, and then run "Eterm -e programname" as root. Is this possible? What would my menu entry look like? Thanks.

*EDIT*

I realized that to open a root terminal, all I need to do is "gksu Eterm" but "gksu Eterm -e programname" does nothing at all.

Last edited by cravengemetzel; 12-28-2012 at 09:06 PM.
 
Old 12-29-2012, 08:25 AM   #2
gradinaruvasile
Member
 
Registered: Apr 2010
Location: Cluj, Romania
Distribution: Debian Testing
Posts: 731

Rep: Reputation: 158Reputation: 158
Maybe

Code:
gksu "eterm -e programname"
If the program name doesnt include quotes.
 
Old 12-29-2012, 10:53 AM   #3
cravengemetzel
LQ Newbie
 
Registered: Dec 2012
Location: Ontario, Canada
Distribution: Netrunner Rolling
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by gradinaruvasile View Post
Maybe

Code:
gksu "eterm -e programname"
If the program name doesnt include quotes.
Adding the quotes like you suggested got me a little further than nothing happening at all; now the password prompt comes up, then the terminal also comes up but only flashes for a fraction of a second before exiting.

The main reason that I want these programs in my menu is so that I remember that I have them installed; many of them need me to feed them an argument else they just print out the help screen (which is okay for the purpose of remembering my installed programs). Those that don't print out a help screen, don't exit immediately. Those that do print a help screen, do exit immediately; openbox interprets the return of the command prompt as the program being terminated. Which it is, I would just rather the terminal window stayed open with the help screen, but I don't think there is a solution to this specific problem.

As the post below me says, scripting is probably my best option. Thanks for your help, I'll mark this thread as solved.

Last edited by cravengemetzel; 12-30-2012 at 06:45 PM. Reason: I realized something important.
 
Old 12-30-2012, 04:10 AM   #4
kareempharmacist
Member
 
Registered: Jan 2012
Location: Cairo, Egypt
Distribution: MX Linux, Ubuntu 18.04
Posts: 336

Rep: Reputation: 42
you need to dive inside bash scripting.. a simple script will solve your problem.
posting your problem in the programming forum will concentrate on the issue..I trying to read about scripting to solve your problem.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Fedora 16: Trying to execute an xinput command at boot up before login. Cmd works in terminal as su Ron Pierce Linux - Newbie 1 04-24-2012 09:41 PM
Root execute command as a normal user carlosjf Linux - Newbie 5 04-01-2011 06:41 PM
[SOLVED] Execute root command without sudo tom4everitt Linux - General 8 01-29-2010 02:44 PM
Execute a command in all tabs in gnome-terminal ganesh_k Linux - Newbie 3 11-01-2008 11:11 AM
Execute shortcut as Root Command? batorma Linux - Newbie 2 11-08-2005 02:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration