How to run graphical apps as su root

Posted by: Andrew Smith
Poster contact info: andrew-smith at mail ru
Author: same as 'Posted by'
Software: Slackware 10.2

For some reason in Slackware 10.2 one can no longer log in as a regular user, su in a terminal (ex. xterm) and run graphical apps such as the seamonkey or mozilla installer.

An example of the error you get is:
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

(seamonkey-installer-bin:6410): Gtk-WARNING **: cannot open display:

The solution to that is to run xhost + before doing the su:
$ xhost +
$ su -
$ seamonkey-installer-bin

Once i figure out a way to have this setting permanent, I will post it here.

Running graphica apps a root - fix it once for all

Posted by: Marcus Britanicus
Poster contact info: marrcusbritanicus@gmail.com
Author: same as 'Posted by'
Software: Debian 6.0, Debian 5.0, Ubuntu 8.0 or greater

xhost + works like a charm. The only thing is that you have to type it every time you login into your system. To make this permanent, just add the following line to ~/.profile:

xhost +

then type in the terminal

$ . ~/.profile

This will make sure you don't have to type the command every time you login. The catch - this work only for you, not for other users.

If you want this to be enabled syste-wide, then add the above line to /etc/profile and type # . /etc/profile. You are up and running. Happily work with any GUI app run as root.