If I launch Thunar from the command line it works, but if I try to launch Thunar using sudo, only the icon on the status bar shows up but no window; the same problem happens with gparted, synaptic and double commander, what is wrong?
If I launch Thunar from the command line it works, but if I try to launch Thunar using sudo, only the icon on the status bar shows up but no window; the same problem happens with gparted, synaptic and double commander, what is wrong?
gvfs admin backend - for elevated permissions with GUI tools
In Ubuntu 17.10 (gvfs >= 1.29.4) and newer versions you can use the gvfs admin backend. Notice that you need the full path, for example
so if you want to manage your
/etc
directory, you can useIn theory, the gvfs admin backend method (which uses PolicyKit) is better and safer (than
xhost
andsudo -H
), regardless of the UI you use.You don't run the whole application as root. Privilege escalation happens only when strictly necessary. See the following link and links from it,
sisco311's reply in the Ubuntu Forums thread 'Which best practice for using gedit as root?'
This is post #4. See also post #6 in the same thread.
pkexec
Alternatives to
gksu
are developed in order to increase the security. Synaptic and Gparted work withpkexec
(another PolicyKit application). Seeman pkexec
.You can run from a terminal window
but the execution using PolicyKit is built into the graphical launch mechanism, so that you see only the pop up window asking for password.
But command line tools (in terminal windows) and
sudo
are often recommended when elevated permissions are necessary. A file browser open with elevated permissions makes it easy to damage the operating system by mistake.