sudo nautilus
is OK but sudo dolphin
is not
Never.
Its bad practice, specifically disallowed ⌠and theres not really any good reason to do so.
(no ⌠sudo nautilus
is not âOKâ eitherâŚ)
but it will be inconvenient when I am trying to copy files and paste into non-home folders via UI
In what scenarios do you actually need to do that?
(and further ⌠are they things that someone who cannot do without drag-drop-gui should be doing?)
But thats all philosophy to me âŚ
The fact is that if you sudo %GUI-APP
you have given root privileges to all of X
( the thing that draws all of the things on your screen )
How bad is this?
No one knows ⌠its so insanely intrinsically broken from a security standpoint ⌠it would be impossible to index, and no one cares to. It is simply the wrong way to do things.
This even applies to deprecated things like gksudo
and kdesu
⌠though those are somewhat better (maybe).
As @cscs said, itâs not okay. However, for Nautilus you can install the nautilus-admin
extension that uses Polkit to open it with elevated privileges. Iâm not sure of an equivalent for Dolphin.
You can make use of Root Actions
for menu entries
disable the non working ones and you can Copy, Move/Rename, Delete files and folders that way. The dialog is not ideal, but if you really need it, is possible that way.
Bah. Thats still broken and shouldnt be used.
If you must do something like that ⌠it should probably look more like this:
Yes, but the menus i show in my screenshot work. I just disable those that donât work, so there is no temptation to click on them. I donât use them actually because i donât need to copy things as root, and if i do, i use terminal.
Was just for the sake of OP.
The ones that work âworkâ in the way that they havent been updated for years and still implement kdesu
in the naturally broken fashion already discussed⌠âworking aroundâ the roadblocks that kde/dolphin devs implemented on purpose.
The example I give above at least uses polkit instead.
(and makes sure you know its the âdanger dolphinâ and such)
Whether or not we want such a hacky âpolkit dolphinâ or just better âsudo cpâ actions ⌠the referenced package should be revised or retired.
If you need use filebrowser gui as root ,you can use krusader but i recommend use mc in konsole instead.
As mentioned this is not really desirable but you can do the below to create a separate dolphin (root) menu item, to use when it is truly needed (as powerfull as the CLI is somethings are just easier in the GUI).
To get around it you can create a copy of the dolphin.desktop file (should be located at: /usr/share/applications/org.kde.dolphin.desktop) in /home/user/.local/share/applications.
Rename the copy to something like âdolphin (root).desktopâ. Edit this new .desktop file and set the exec option to: âExec=pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true dbus-launch dolphin %uâ.
To add it to the service menu you can copy this new .desktop file to /home/user/.local/share/kservices5/ServiceMenus (If the path does not exist simply create it).
You more or less have to get accustomed to using the command line for copying with root privileges. There is proper polkit support for Dolphin / KIO as a whole in the works but progress on it has been very slow, despite it being almost finished. You can have a look at it here: â D7563 Add privilegeExecution field to file protocol description
I just tried this in a VM, it worked perfectly. I was able to get the expected behavior of using dolphin normally and getting dolphin to escalate from the root actions menu. It survived reboots and everything.
When I tried this on my laptop installed from the same image as the vm, itâs backwards. When I open a folder on the desktop it asks for root password and gives me a root file manager. The root actions menu however, doesnât work. Itâs possible I did something wrong, so I am reflashing to try again.
If that doesnât work out, anyone have any suggestions?
I toyed with the idea of other file browsers, but other than konqueror they seem to break the trash widgets. I like everything about plasma except this.
I find this to be highly unusable, which is an unfortunate thing.
Edit:
I got it. I needed to add that line to a totally different file, 10-rootactionsfolders.desktop, and it works. Nowhere else is it needed.