I just heard that it isn't recommended to use sudo -i on GUI programs - because it's less secure.
Is there any truth here - is there an advantage to this:
sudo -i gedit /random/file.name
over
pkexec gedit /random/file.name
I used to use gksudo, but that's been phased out, so now I use sudo -i to prevent root owning files in my home area. But should I really be using pkexec?
Here is a reason:
The environment that PROGRAM will run [in], will be set to a minimal known and safe environment in order to avoid injecting code through
LD_LIBRARY_PATHor similar mechanisms. In addition thePKEXEC_UIDenvironment variable is set to the user id of the process invokingpkexec.