When I try to execute the command kdesu dolphin
or kdesudo dolphin
nothing happens. I thought that this was the proper way to elevate graphical applications to temporary root privileges.
Am I doing something wrong? How can I elevate graphical application to super user level permissions?
sarah@ConvergentRefuge:~$ kdesu dolphin
kdesu: command not found
sarah@ConvergentRefuge:~$ kdesudo dolphin
kdesudo: command not found
This is a very much more complex question than it first appeared to me to be :)
First of all, it is highly recommended not to use
kdesu
orkdesudo
to run graphical applications as root or with administrative privelages.Why is it not recommended?
The short answer is that it is considered a substantial security risk.
The security risk is being discussed at length (and disputed) in a number of different posts and bug reports.
@DK Bose kindly provided some links as a good starting point for anyone who wants a bit more detail: https://www.kubuntuforums.net/showthread.php/71347-KDE-file-manager-problem
The above link led me to some other links which show a 'lively' discussion about it: https://bugs.kde.org/show_bug.cgi?id=152150 and also https://bugs.kde.org/show_bug.cgi?id=179678
which in turn led me to a blog post about the security problem that is being discussed:
https://blog.martin-graesslin.com/blog/2017/02/editing-files-as-root/
Basically, to prevent users from exposing themselves to this security risk, running Kate or Dolphin as root has been disabled.
Kate now allows you to save system files etc. by asking you to enter your password when you require permission to save your file (via Polkit - i.e a system dialogue box appears requesting permission). This should mean it is not necessary to run Kate as root.
Dolphin will be doing the same in the near future but the change has not been implemented yet.
(On the sometimes heated discussions about this change, there were criticisms that disabling running Dolphin as root should not have been implemented until an alternative was in place. The counter argument was that the security risk was too great to allow it.)
In the meantime, there are other file managers such as PCManFM or Thunar which allow running as root (for those who understand the security implications but require the functionality).
I can't think of a lot of situations where it would be necessary to run a graphical user application as root outwith the 'editing system files' scenario. Kate can do this now without needing to be run as root.
Some of the use cases that sparked arguments against disabling running Dolphin as root, involved users wanting to create symlinks on their system files whilst using the GUI and also for penetration testing where, for example, Kali Linux runs the entire session as root.
The other reccurring argument was that if a user was aware of the security risk and wanted to run graphical applications as root anyway, then they should be allowed to do so.
kdesudo is not installed in Kubuntu 18.04 by default and is no longer in the Debian and Ubuntu repositories. It is not recommended to be used because it is unmaintained (and the general suggestion that you shouldn't be running graphical user interface programs with X as root).
kdesu is installed (as part of kde-cli-tools) but is not in your $PATH by default. You can access the binary from
/usr/lib/x86_64-linux-gnu/libexec/kf5/kdesu
(and create a symlink in your/usr/local/bin
directory if you don't fancy typing that out each time you want to use it - https://www.kubuntuforums.net/showthread.php/73471-Kdesudo?highlight=kdesudo), but it is not recommended that you do so (due to the security implications) and will not work for Kate and Dolphin anyway.Use this commands as root:
This worked for me on Kububuntu 19.04: