sudo access for desktop actions in Gnome/KDE?

10

1

I feel kinda silly asking this question. I'm using CentOS 5.4 and KDE. I downloaded an archive and I want to drag/drop the contents into a folder that I need root access to write to.

I can obviously go into terminal and sudo blah blah. But how do I get sudo access for desktop procedures? Like for simple dragging and dropping of files? KDE just tells me that I don't have permission to do that, but doesn't give me the option of entering the root password or sudo.

Jake Wilson

Posted 2010-04-27T20:43:12.757

Reputation: 3 044

Answers

4

Create a shortcut to your favourite file manager (Konqueror, Dolphin or whatever) on your desktop. Right click on it, and click "Properties". On the "Application" tab, click "Special settings", and check the "Run as different user" check box (the exact phrases may be different, because I'm not using English KDE). At least it is how it is done in KDE 4, but on KDE 3 it is very similar. Or you can simply write "kdesu" before the command name.

Open the file manager with this shortcut, and do the copying from here. Be warned, though, that any application you run from this file manager will be run as root.

petersohn

Posted 2010-04-27T20:43:12.757

Reputation: 2 554

3wow.... I really wasn't expecting the answer to require so many hoops to jump through. No offence to the die-hard Linux nuts out there, but its reasons like this why Linux will never be mainstream desktop software. I can't imagine explaining stuff like this to my mom over the phone. It's amazing there isn't a simple "Enable sudo for all actions" button in KDE/Gnome where you type in your sudo password lets you do stuff. Just as if you were at a bash prompt. – Jake Wilson – 2010-04-27T21:33:08.287

Of course there is also such a possibility: just allow login as root, and then autologin as root. With that you don't have the explain to your mama how to "sudo" anything, but anyone in your family could drag and drop your /boot in the trash and then empty the trash... – dag729 – 2010-04-27T22:49:57.713

1@Jakobud: if you think that's difficult, try doing the same thing in Windows ;-) You do have a point, though: allowing privilege escalation for file copy/move operations could be a useful feature that KDE does not currently have, probably because nobody's felt the need strongly enough to implement it. – David Z – 2010-04-28T01:17:02.537

@Jakobud: You can do it in simpler ways. For example: Start -> Run command -> "sudo dolphin". But then you have to do this every time. And if someone can't do that seemingly complicated, but quite straightforward action, they better not try this in the first place. Running things as root is dangerous. If you are a beginner, everything you need to do as root is available through the menu (like installing programs, changing login screen etc.). – petersohn – 2010-04-28T16:55:39.827

1@dag729: Not every distribution allows you to login as root. Ubuntu, for example, don't. SUSE, on the other hand, does. I don't have experience with other distributions. @David: On Windows Vista+, it is surprisingly easy. If a program wants to do something that requires root privileges, it will simply ask the user if they want it or not (provided that you have root privileges in the first place). – petersohn – 2010-04-28T17:00:52.293

Why can't there be some sort of automatic temporary privilege escalation whenever an GUI action is rejected, but the current user is detected to be a "sudoer". Kind of like how Windows will prompt the user for authentication if you try and do something that requires higher privileges. – CMCDragonkai – 2015-12-11T16:17:42.907

@CMCDragonkai Because user management in Linux is somewhat different from that on Windows and it would be more complicated to implement. Also there isn't much use case for it. As it was said before, everything an ordinary user needs to have root privileges is accessible through the menu. If you want to copy files somewhere that requires root privileges then you are probably not an ordinary user and know how to use sudo. – petersohn – 2015-12-12T08:09:50.870

On desktop Linux all the programs that need root privileges (package manager, login settings, printer setup and so on) will ask for the password when required. If you're trying to explain to your mum how to edit system files with sudo commands you're doing something wrong and she'll likely mess up her system, similar to if you tried to have her edit the Registry on windows – happyskeptic – 2014-06-17T14:33:39.020

4

gksu, kdesu or gksudo, kdesudo

See more: Ubuntu Forums – HOWTO: Easily open any file as root via drag & drop

Create a launcher with the following command:

gksudo "gnome-open %u"

Anonymous Coward

Posted 2010-04-27T20:43:12.757

Reputation: 41

Of these choices only kdesu is actually available under CentOS. None of these methods is available. – slm – 2013-12-04T02:31:49.837

3

You'll have to use kdesu <appname>

Example: Launch Konsole, and type kdesu dolphin or kdesu konqueror

Sathyajith Bhat

Posted 2010-04-27T20:43:12.757

Reputation: 58 436

1

Follow these directions, but replace nautilus with dolphin or whatnot.

Ignacio Vazquez-Abrams

Posted 2010-04-27T20:43:12.757

Reputation: 100 516

0

In Cent OS You can go to "System> Add/Remove Software"

search for "beesu" and install it

then from the desktop right click >Create Launcher and set the command as beesu [filename]

Nublet

Posted 2010-04-27T20:43:12.757

Reputation: 1