LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Launch an editor from desktop in su mode? (https://www.linuxquestions.org/questions/linux-newbie-8/launch-an-editor-from-desktop-in-su-mode-115913/)

jkpalmer52 11-14-2003 08:14 AM

Launch an editor from desktop in su mode?
 
Is there a way to launch gedit (or any other good editor for that matter) from an icon in su mode?

randomblast 11-14-2003 09:10 AM

with what?
kde, gnome, windowmaker...
i think in kde you can choose "run as different user" in the icon properties.
oh, and gedit sux, use emacs (no offense whoever made gedit)

itsjustme 11-14-2003 09:29 AM

I just tested this on Red Hat 8.

Right click on the desktop.
Choose Create New
Choose Link to Application
General Tab: gedit (just the name)
Execute: gedit (the command)
--------: check Run as a different user, Username : root

Then when you click on the new icon, it will ask you for root password.
And you're off...

Edit: This is with KDE.

jkpalmer52 11-14-2003 09:51 AM

sorry. I'm using gnome.

itsjustme 11-14-2003 09:53 AM

Does gnome not have a similar right click on the desktop to add an icon and set the user?

jkpalmer52 11-14-2003 09:56 AM

There's a right click to create a new "launcher", but no option to set the user.

Nimoy 11-14-2003 10:31 AM

If you're using Red Hat - Try this

1) Right Click on your desktop

2) Select open new terminal

3) DON'T PANIC !

4) Type: su <Enter>

5) Input your password and press <Enter>

6) Type mc <Enter>

If the midnight commander is installed you'll be able to scroll through files like in the old Norton Commander

When you find the file you need to edit press F3 to edit - F4 to view

When you're done - Save the file (the key's needed are shown on screen)

Back at the prompt type: Exit <Enter>

You are now out of root mode

Type Exit once more and you're back in your Desktop environment...

itsjustme 11-14-2003 10:39 AM

Man, that's a little way past clicking on an icon as jkpalmer52 is asking about, eh?

Nimoy 11-14-2003 10:58 AM

Prolly is - but if jk... needs to fix something in a hurry... well then he/she might as well be informed on how to potentially fix it...

However if anyone has an easy solution.... join in!

Another way would be writing a script thet was executed by clicking on a launcher placed on the desktop.

The script would begin by issuing the su command - You would then be compelled to enter your pwd - the script would then launch gedit or whichever editor you wanted...

Nimoy 11-14-2003 11:14 AM

Next method

Open a terminal window

Type su

Type your pwd

Type gedit

Boom! - You can now edit and save the protected file in the GUI editor :)

jkpalmer52 11-14-2003 11:21 AM

That was the obvious choice. I was looking for something real quick. The kdesu konqueror works very well for my needs.

Thanks to all who jumped in.

Nimoy 11-14-2003 11:26 AM

Good - but please try to keep your question in separate thread don't double post the same questions! That way people will also better be able to search for answers if the threads are clean and specific so to speak...

jkpalmer52 11-14-2003 11:32 AM

Sorry. It started out as a global question. I'll be more careful next time about double posting. Would that also apply for "double chastising"? ;-)

Nimoy 11-14-2003 12:28 PM

Lol - Knew I was going to hear about that :) - Don't know about the double chastising...

I can fully understand the frustration when there is a lack of info though.... which is why I didn't report the double post... I just wanted to make the point as searching specifics is always better than.... well you understand - Heck I suspect I did something similar in my early days :)

Glad that things were resolved


All times are GMT -5. The time now is 04:25 AM.