PDA

View Full Version : Opening Programs With Root Privileges



carney1979
7th July 2006, 04:42 PM
Several programs on my FC 5 box open a dialog so you can enter the root password and temporarily gain root privileges.

Sometimes I have a need to edit a program that requires root privileges to do so.

For example, let's say I need to make a quick change to /etc/fstab. Of course I have to be root to do so.

Is there a way to open Gedit with root privileges and edit the file WITHOUT opening a console and using sudo or su?

Debian systems make this an easy task by using gksudo or gksu.

David

daneel971
7th July 2006, 04:52 PM
both Krusader and Konqueror have a service menu for "edit as root"

carney1979
7th July 2006, 05:02 PM
both Krusader and Konqueror have a service menu for "edit as root"

Ooops.

I left out that I'm running Gnome.

David

daneel971
7th July 2006, 05:08 PM
provided that you have the kdelibs installed, krusader will work in gnome (and it's a great file manager). I'm sure that there are service menus even for nautilus, anyway.

brahms
7th July 2006, 06:12 PM
Open a terminal and type:

$ su -
Password: (your root password)
# gedit /etc/fstab &

carney1979
7th July 2006, 06:47 PM
Is there a way to open Gedit with root privileges and edit the file WITHOUT opening a console and using sudo or su?


brahms wrote:



$ su -
Password: (your root password)
# gedit /etc/fstab &


brahms, please reread my original post more carefully.

Thank you.

David

carney1979
7th July 2006, 07:26 PM
I found gksu in the dries repository.

This seems to be a "hack" of some sort. I had to symlink /usr/bin/xauth to /usr/X11R6/bin before it would work.

I installed nautilus-actions (extras repository) and configured an action using gksu and gedit.

Now I can right-click on a file, select "Edit as Root" and it opens in a root gedit.

David