In old ubuntu releases, I believe, GUI apps ask for root password using gksudo. Now gksudo
not comes preinstalled in ubuntu. For me, if I am adding a custom launcher of a compiled executable which needs to be run as root, I need to install gksudo
and add gksudo -k -u root
, followed by the execution command. But in certain apps, like Synaptic Package Manager, Unetbootin ect, (which is installed via apt) can ask root password through GUI environment similar to good old gksudo
. Actually How its being possible?
Ubuntu – How GUI based apps ask for root password without gksudo installed
gksudosudo
Best Answer
As ssta properly mentioned there is something known as
pkexec
which is part ofpolicykit-1
package. You can verify that it is installed withdpkg --get-selections | grep policy
. However, it doesn't necessarily mean it has a GUI front-end. The GUI front end is provided by another package -policykit-1-gnome
for Unity and Gnome. For other desktop environments there are additional packages that provide GUI for their respective environment.For more info on this tool refer to
Why is pkexec preferred over gksudo for graphical applications?
When to use pkexec vs. gksu/gksudo?