> I am using OpenSuse 11.1 and i cant find a way to make sudo open X
> programs like gedit
> > diego@linux-8mmd:~> sudo gedit
> No protocol specified
> (gedit:5500): Gtk-WARNING **: cannot open display: :0.0
> diego@linux-8mmd:~> sudo xhost +localhost
> xhost: unable to open display “”
> gnomesu works, but it asks for password.
You force the same error twice. sudo lets a process run as root and is
not allowed to open a window on the display you diego have.
Then you use sudo again running xhost as root. But root can not help
you here, it has no display. diego must run xhost. So leave out the
diego@linux-8mmd:~> xhost +
Now you, diego, allow everybody (including root) to open a window on
It is not the command -sudo, -but the user -root -you have to allow. And
indeed, a plain -xhost + -does allow “anybody” to open windows before
your very nose . Now do not be to afraid of this, Those from other
systems are normaly blocked from doing so by your firewall. And those
from inside your system … well, when this is a pc there will not be
But yes you can restrict. Your -+localhost -is restricting it to those
comming from localhost (127.0.0.1), that is “inside”.
You could read the -man xhost- page (as I did). It talks about
usernames, but I can not find out how . But as said, -localhost -may
be enough security.
BTW I think (but not quite sure, please test) that once a + entry is
added to the list, it stayes there over the following log-ins (somewhere
in a -.X*- or -.x*- file in your home directory). Just a
will tel you what the situation is. Eventualy first do a