Help - Search - Members - Calendar
Full Version: Logging in as root graphically?
MandrivaUsers.org > Advanced Topics > Security
FlyingPenguins
Occasionally, in Mandriva 2008 I need to log in as root graphically from my current account that has lower permissions. Sometimes I need to do tasks that I can't do on my normal account, such as removing entries from the GRUB config file if Mandriva decides to add extra entries onto it for some reason, or placing/removing files from protected directories.

Yes, I understand the risks with doing things under root, but some things I find would be much easier doing graphically rather than in a console with su.
liquidzoo
There is a menu option, and forgive me because I've forgotten where it is but I know it's inside one of those 'more applications' links, that will allow you to open a file browser as root which will allow you to edit those files through a gui editor if you choose.

Another option, and I know you said you didn't like the command line, would be to open a terminal (or the run command option) and type:

su -c 'kwrite /path/to/file'

with the quotes and that will open up that file, in kwrite, as root after prompting you for the root password.
Greg2
You can also use
CODE
kdesu kwrite
to edit files. Alternatively, you could install the 'openasroot-kmenu' package. Then you can right-click on a file > actions > edit as root.
ianw1974
You don't need to login as root. Just use gksu in Gnome or kdesu in KDE to get the root privileges as and when you need it. For example, to edit grub config.

CODE
Press ALT-F2
gksu gedit /boot/grub/menu.lst


supply root password, then do what you want with the file. Or, for KDE:

CODE
Press ALT-F2
kdesu kwrite /boot/grub/menu.lst


will solve all your problems. The gksu/kdesu is the same as the console su command but graphically being ran. Then you just give it the command you want to run, for example gedit/kwrite to open a notepad equivalent for editing files, and then the last part the actual file to edit.

Alternatively, forget the filename, and then just open it later once gedit/kwrite is running.

EDIT:

greg2 beat me to it lol.
FlyingPenguins
Thanks for your quick replies, everyone. I was able to finish I needed to get done. The openasroot-kmenu thing works great as well.

However, I found that the gksu command doesn't work. Another question, does kdesu only work with kwrite?
ianw1974
kdesu is a KDE command, whereas gksu is a gnome command. If you don't have Gnome installed and running, then it won't work for you. Therefore, kdesu is to be used with KDE, and then whatever application that follows it, kwrite, kate, konqueror, firefox, etc, etc.
Greg2
If you're using the KDE desktop, you would need to install gksu, but you really don't need it.

You can use kdesu on most kde apps, to run them as root, but be careful. It's better for you now, until you become more familiar with Linux to use the openasroot tool (IMO).


Edit: Ian beat me to it that time.
FlyingPenguins
Thanks for explaining it guys.

The developers really need to think of less ambiguous names. laugh.gif
arctic
My approach is almost as easy as the above mentioned ones. First I install nano. Way easier to use and more intuitive editor than vi imho. Then I open a terminal window, log in as root on the command line and launch

nano /boot/grub/menu.lst

then edit the entries, save and exit. That's it. It is not more complicated than logging into a gui as root and it is more secure. Just give nano a try, I do believe that you will like it. 2thumbsup.gif
ianw1974
I use nano also, but then i tend to do most things from the command line.
scarecrow
The most flexible solution is using sudo, but this requires proper editing of the /etc/sudoers configuration file beforehand (via the visudo command), and some people are rather unfamiliar with the vi text editor.
willie
If you wan't to work graphical (just like me) use "openasroot" as sayd before, there is no need to log in as "root".
Besides it's by standard disabled in Mandriva 2thumbsup.gif
ffi
linux needs an elevate rights button popping up in case an application needs more rights to do what you tell it to, maybe using policykit....

my new laptop uses face recognition to login, actually it's an addon made by asus, together with policykit it could make administritive rights very secure and yet unobtrusive (confirm identity and click yes to confirm administrative request)....
ianw1974
Linux does do this for some applications. If you try to change the clock time/date, for example, it will ask you for root password. It doesn't do it for all apps, since some can be run as normal user as well as root user just some functionality is disabled if you run it standard.
tyme
QUOTE (ffi @ Jun 19 2008, 05:22 PM) *
linux needs an elevate rights button popping up in case an application needs more rights to do what you tell it to, maybe using policykit....
Talk to the developers of the application in question. The ability is there, but it's up to the developers of the application to implement it.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.