How to start restricted graphical applications

root's picture

If you want to open some restricted graphical application with your username, you can get the following error:

vbox@core:~$ su - root -c gparted
(gpartedbin:27091): Gtk-WARNING **: cannot open display:

Well, there is a better and efficient way, via gksudo or gksu. They are doing practically the same thing, only the authentication is different. For gksudo you need to be in sudoers list and you input your user's password and for gksu you need the root password. Below you have an example with gksu:

vbox@core:~$ gksu gparted
libparted : 1.8.8

At this point, you will be prompted to input the root password:

That's pretty much it!

Thou shalt not steal!

If you want to use this information on your own website, please remember: by doing copy/paste entirely it is always stealing and you should be ashamed of yourself! Have at least the decency to create your own text and comments and run the commands on your own servers and provide your output, not what I did!

Or at least link back to this website.